| Age | Commit message (Collapse) | Author |
|
Explain the second and third return values: match and maxlen.
|
|
Per RFC 9562 Section 5.9,
A Nil UUID value can be useful to communicate the absence of any
other UUID value in situations that otherwise require or use a
128-bit UUID.
A Nil UUID can express the concept "no such value here".
Thus, it is reserved for such use as needed for
implementation-specific situations.
In case of SQL, the Value method should return nil if ID is zero.
|
|
|
|
|
|
Using diff Unified improve the test output readability when two large
strings are not match.
|
|
Using Words seems like misleading since we capture the characters
difference, not a word as in human language.
|
|
In the struct Data, we add new method WriteLineChunks to print the
LineChunks data into [io.Writer] w.
|
|
In the struct Data we also rename field Changes to LineChunks.
|
|
Defining []T as new type does not help on readability only make it
confusing for future maintenances.
|
|
While at it,
- reorganize the order of functions alphabetically, following
the order from doc.
- changes the [Line.String] to print text in double quoted to help human
compare the changes for non-printable characters.
|
|
While at it, rename the source file to reflect the content, instead of
diffinterface.go name it func.go.
|
|
While at it, use consistent receiver "diff" for Data and return *Data
from Text, Lines, Files, and Unified.
|
|
I cannot remember the use case for implementing IsEqual.
Seems like the original purpose of IsEqual is to compare minimum length
between two slices of bytes.
|
|
|
|
The reason for refactoring is we will add more fields to the Line type
to handle unified diff.
In the ParseLines, we changes the line number to start from 1, to make it
consistent with ReadLines and file line numbering.
This causes a lot of changes in the expectation files in testdata.
|
|
|
|
The Meta method returns new instance of [Meta] based on the current
client driver and kind arugment.
While at it, update comments on most methods to use adjectives.
|
|
Changes the BindWhere parameters from two to four.
The first parameter is the OR/AND logic.
The second parameter is the column name.
The third parameter is the operator like "=", "!=".
The fourth parameter is the value.
|
|
|
|
Using Func suffix to function variable is common coding styles in Go.
|
|
Adding suffix version to the type seems not right (and also mouthful to
read) since the package already defines the version of UUID.
|
|
|
|
This is to simplify checking for equality in if-condition.
|
|
If the UUID value being unmarshaled or scanned is not valid, don't changes
the current value.
|
|
== cmd/httpdfs
🌱 Add option to set base path and shutdown idle duration
The -base-path option set the URL prefix for serving HTTP request.
The -shutdown-idle option set the duration when server will stop
accepting new connections and shutting down.
== lib/dns
🪵 lib/dns: refactoring DoT and DoH to use address instead of port
Using port makes the IP address of DNS-over-TLS (DoT) and DNS-over-HTTPS
(DoH) listen on the same address with UDP. If we set ListenAddress to
0.0.0.0 and TLS termination is handled by proxy, this cause DoT and DoH
will also listen on all addresses (the ports open to public).
== lib/http
🌱 Add BasePath to the ServerOptions
The BasePath allow server to serve HTTP from custom prefix, other than
"/".
Each request that server received will remove the BasePath first from
the [http.Request.URL.Path] before passing to the handler. Each redirect
that server sent will add the BasePath as the prefix to redirect URL.
Any trailing slash in the BasePath will be removed.
🌱 Implement server auto shutdown when idle
In the ServerOptions, we add option ShutdownIdleDuration when set to
non-zero value it will start a timer. When the timer expired, the server
will stop accepting new connection and then shutting down.
This allow de-activating HTTP server when no connections received after
specific duration to reduce the system resources.
🌼 lib/http: fix possible data race in SSE connection
When server’s handler call Write or WriteRaw, there is possibility that
the worker for keeping the connection alive also call Write at the same
time, which cause the data race.
== lib/paseto
🪵 Move paseto v2 under sub directory "v2"
There are new versions of paseto standard: version 3 and version 4. To
minimize conflicts in the future, we move the old implementation of
paseto v2 to sub directory "v2" with package name "pasetov2".
🌱 lib/paseto/v4: new package that implements Paseto version 4
paseto/v4 provides a simple, ready to use, opinionated implementation of
Platform-Agnostic SEcurity TOkens (PASETO) version 4 as defined in
[paseto-v4].
[paseto-v4]: https://github.com/paseto-standard/paseto-spec/blob/master/docs/01-Protocol-Versions/Version4.md
== 🌱 lib/uuidv7
New package that implements UUID version 7.
The uuidv7 package provides type UUIDv7 as the container for UUID
version 7 that satisfy the [database/sql], [encoding/gob], and
[encoding/json].
The implementation follow RFC 9562.
|
|
This fix the following error detected by gocheck,
public_mode_test.go:45:16: struct with 288 pointer bytes could be 264
|
|
Column with NULL value will returns no error but zero UUID.
|
|
If the footer is empty then the message will be unpacked with its own
public key, instead of sender public key.
|
|
Unpacking v4 public protocol on parent package seems wrong.
Only v4 package should know how to unpack it regarding the available
fields in the Message.
|
|
The paseto/v4 now can replace the previous paseto/v2 package.
|
|
This is to make user can increases or decreases the leeway during
Payload Validate.
|
|
|
|
|
|
This provides simple operation when working with Pack and Unpack.
|
|
By not using the same package name in example, we can see how the package
actually used in real code.
For instance, we can know that constant publicHeader should be exported
so it could be used by Unpack method.
|
|
Instead of fixed strings, predefined the error variables so the caller
can check the actual error.
|
|
The Pack method returns the signed [paseto.Message] as public token.
The token then verified and decoded into Message using the Unpack method.
|
|
Previously, we use time.Time to store the value for ExpiredAt, NotBefore,
and IssuedAt.
Even thought this is allowed (see RFC 7519 section 2, NumericDate) but
it is not a standard practices.
This changes them to store Unix epoch with int64.
|
|
The [v2/PublicToken] has been moved and renamed as [paseto.Message].
The Data field in the Message is removed since its duplicate with
[Payload.Data].
The [v2/JSONToken] has been moved and renamed as [paseto.Payload].
In the [Payload.Validate] method, we remove the validation for IssuedAt
field, since its usage is to store the time the token is created.
The Data field type in the Payload changes from string to any.
The [v2/JSONFooter] has been moved and renamed as [paseto.Footer].
The type of Data field in Footer changes from map[string]any to any.
The KID field in the Footer has been renamed to PeerID along with its
json identifer.
The [v2/Key] has been moved and renamed as [paseto.Peer].
|
|
paseto/v4 provides a simple, ready to use, opinionated
implementation of Platform-Agnostic SEcurity TOkens (PASETO) version 4
as defined in [paseto-v4].
The public protocol contains method to sign and verify the message
into/from paseto token.
[paseto-v4]: https://github.com/paseto-standard/paseto-spec/blob/master/docs/01-Protocol-Versions/Version4.md
|
|
paseto/v4 provides a simple, ready to use, opinionated
implementation of Platform-Agnostic SEcurity TOkens (PASETO) version 4
as defined in [paseto-v4].
[paseto-v4]: https://github.com/paseto-standard/paseto-spec/blob/master/docs/01-Protocol-Versions/Version4.md
|
|
|
|
There are new versions of paseto standard: version 3 and version 4.
To minimize conflicts in the future, we move the old implementation of
paseto v2 to sub directory "v2" with package name "pasetov2".
The paseto package now left with common functions, like creating
pre-authentication encoding (PAE).
|
|
There is an issue with current SSH client implementation.
Given a single host public key in the known_hosts file,
host ssh-ed25519 key...
Calling ssh.Dial(`tcp`, "host", ...) will return an error
knownhosts: key mismatch
from [handshakeTransport.enterKeyExchange], because only key
"mlkem768x25519-sha256" is checked on the client side.
This changes add DB interface for knownhosts that have two methods:
- HostKeyAlgorithms: return the host key that matches in known_hosts
based on the "host" name or address for
[ssh.ClientConfig.HostKeyAlgorithms].
- HostKeyCallback: return the ssh.HostKeyCallback for
[ssh.ClientConfig.HostKeyCallback].
|
|
Using port makes the IP address of DoT and DoH listen on the same
address with UDP.
If we set ListenAddress to 0.0.0.0 and TLS termination is handled
by proxy, this cause DoT and DoH will also listen on all
addresses.
|
|
The Value method returns the value for sending it to the
database.
|
|
The Equal method returns nil if both receiver and parameter has
the same value.
This method implements [lib/reflect.Equaler] interface.
|
|
|
|
The uuidv7 package provides type UUIDv7 as the container for UUID
version 7 that satisfy the [database/sql], [encoding/gob], and
[encoding/json].
The implementation follow RFC 9562.
|
|
If a GitHub Actions job or workflow has no explicit permissions set,
then the repository permissions are used.
Repositories created under organizations inherit the organization
permissions.
The organizations or repositories created before February 2023 have the
default permissions set to read-write.
Often these permissions do not adhere to the principle of least
privilege and can be reduced to read-only, leaving the write permission
only to a specific types as "issues: write" or "pull-requests: write".
|