Documentation
¶
Overview ¶
Package hex validates Hex tarballs and extracts metadata needed by the signed registry v2 protocol. It never executes metadata.config as Erlang.
Index ¶
- Constants
- func DecodeNames(body []byte, key *rsa.PublicKey) (string, []string, error)
- func DerivedPath(p string) bool
- func EncodeNames(repository string, names []string, private *rsa.PrivateKey) ([]byte, error)
- func EncodePackage(reg RegistryPackage, private *rsa.PrivateKey) ([]byte, error)
- func EncodeVersions(repository string, packages []RegistryPackage, private *rsa.PrivateKey) ([]byte, error)
- func Files(ctx context.Context, st store.Store, c repo.Config) ([]types.Item, error)
- func IsTarballPath(p string) bool
- func ParsePublicKey(value string) (*rsa.PublicKey, error)
- func PublicKeyPEM(key *rsa.PrivateKey) string
- func Serves(t repo.PackageType) bool
- func TarballPath(name, version string) (string, bool)
- func ValidName(name string) bool
- func ValidVersion(version string) bool
- type Handler
- func (Handler) Admit(ctx context.Context, env format.Env, c repo.Config, w format.Write) (format.Write, error)
- func (Handler) Classify(_ repo.Config, p string) format.Class
- func (Handler) Deployed(ctx context.Context, env format.Env, c repo.Config, it types.Item) error
- func (Handler) Inspect(ctx context.Context, env format.Env, _ repo.Config, w format.Write) (any, error)
- func (Handler) Reindex(ctx context.Context, env format.Env, c repo.Config) error
- type Package
- type RegistryPackage
- type Requirement
Constants ¶
View Source
const (
MaxTarballBytes = 64 << 20
)
Variables ¶
This section is empty.
Functions ¶
func DecodeNames ¶
DecodeNames verifies a signed upstream /names resource before it is used to build a new resource under this repository's own signing key.
func DerivedPath ¶
func EncodeNames ¶
func EncodePackage ¶
func EncodePackage(reg RegistryPackage, private *rsa.PrivateKey) ([]byte, error)
func EncodeVersions ¶
func EncodeVersions( repository string, packages []RegistryPackage, private *rsa.PrivateKey, ) ([]byte, error)
func IsTarballPath ¶
func PublicKeyPEM ¶
func PublicKeyPEM(key *rsa.PrivateKey) string
func Serves ¶
func Serves(t repo.PackageType) bool
func TarballPath ¶
func ValidVersion ¶
Types ¶
type Package ¶
type Package struct {
Name string
Version string
Requirements []Requirement
InnerChecksum [32]byte
OuterChecksum [32]byte
// These signed registry fields are retained when a remote view is
// permission-filtered and re-signed. Local tarballs do not carry them.
Retirement []byte
AdvisoryIndexes []uint64
PublishedAt []byte
}
type RegistryPackage ¶
type RegistryPackage struct {
Name string
Repository string
Releases []Package
Advisories [][]byte
}
RegistryPackage is the verified content of /packages/NAME. Release checksums are binary SHA-256 digests, exactly as Hex registry v2 prescribes.
func DecodePackage ¶
func DecodePackage(body []byte, key *rsa.PublicKey) (RegistryPackage, error)
func DecodeVersions ¶
DecodeVersions verifies a signed upstream /versions resource.
Click to show internal directories.
Click to hide internal directories.