Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CommitID ¶
func CommitID(c CommitContent) string
CommitID returns the lowercase hex SHA-256 of the canonical commit preimage.
func CommitPreimageBytes ¶
func CommitPreimageBytes(c CommitContent) []byte
CommitPreimageBytes returns the raw bytes that CommitID hashes. Exported so tests can pin the exact byte sequence, not just the hash.
func RequestPreimageBytes ¶
func RequestPreimageBytes(r RequestContent) []byte
RequestPreimageBytes returns the canonical bytes to be signed (or verified).
Types ¶
type CommitContent ¶
type CommitContent struct {
Message string
AuthorID string
CreatedAt int64 // Unix ms, set by the client at commit time
Parents [][]byte // 32-byte raw hashes in order (first parent, second for merge); NOT sorted
Files []CommitFile
}
CommitContent is the input to CommitID and CommitPreimageBytes.
type CommitFile ¶
CommitFile is one file entry in a commit.
type RequestContent ¶
type RequestContent struct {
PrincipalID string
Method string // uppercase ASCII: "GET", "POST", …
RequestTarget string // endpoint path + query string, exactly as sent
Timestamp int64 // Unix ms
BodySHA256 []byte // 32 raw bytes; SHA-256 of empty body if none
}
RequestContent is the input to RequestPreimageBytes. The preimage bytes are passed directly to ed25519.Sign (which hashes internally).
Click to show internal directories.
Click to hide internal directories.