{"modulePath":"github.com/liquidgecka/blobby","version":"v0.0.0-20261108055455-e9a390ceacc7","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package secretloader\n\n## Types\n\n```go\ntype AESKeys struct {\n\t// The source for AES key data.\n\tSource Loader\n\n\t// All logging for the certificate manager will be done via this Logger\n\t// object.\n\tLogger *slog.Logger\n\t// contains filtered or unexported fields\n}\n```\nAn AES Key loader implementation.\n\n```go\nfunc (a *AESKeys) Keys(ctx context.Context) ([]cipher.Block, error)\n```\nReturns the current list of keys loaded from the secret.\n\n```go\nfunc (a *AESKeys) PreLoad(ctx context.Context) error\n```\n\n```go\nfunc (a *AESKeys) StartRefresher(ctx context.Context)\n```\nStarts the cache refresher.\n\n```go\ntype Certificate struct {\n\t// The Loader that will fetch the bytes needed for the public portion of\n\t// the certificate.\n\tCertificate Loader\n\n\t// The loader that will fetch the bytes needed for the private portion\n\t// of the certificate.\n\tPrivate Loader\n\n\t// All logging for the certificate manager will be done via this Logger\n\t// object.\n\tLogger *slog.Logger\n\t// contains filtered or unexported fields\n}\n```\nA Generic interface around certificate loading.\n\n```go\nfunc (c *Certificate) Cert(ctx context.Context) (*tls.Certificate, error)\n```\nReturns the certificate loaded via the Load() call.\n\n```go\nfunc (c *Certificate) PreLoad(ctx context.Context) error\n```\nReturns true if this secret is expected to be pre-loaded at startup.\n\n```go\nfunc (c *Certificate) StartRefresher(ctx context.Context)\n```\nStarts a goroutine that will periodically refresh the data in the secret if configured to do so. This routine will stop processing if the passed in context is canceled.\n\n```go\ntype HTPasswd struct {\n\t// The source for htpasswd data.\n\tSource Loader\n\n\t// All logging for this loader will be done via this logger.\n\tLogger *slog.Logger\n\t// contains filtered or unexported fields\n}\n```\nLoads an .htpasswd file style file from the secret.\n\n```go\nfunc (h *HTPasswd) HasTags(\n\tctx context.Context,\n\tuser string,\n\ttags []string,\n) (\n\tbool,\n\terror,\n)\n```\nVerifies that the given user name has the tags given. The return values represent true if the user exists, true if the user exists and has the given tags, and an error if something goes wrong during the secret fetching process.\n\n```go\nfunc (h *HTPasswd) PreLoad(ctx context.Context) error\n```\nPreloads the htpasswd file if configured to do so.\n\n```go\nfunc (h *HTPasswd) StartRefresher(ctx context.Context)\n```\nStarts the cache refresher.\n\n```go\nfunc (h *HTPasswd) Verify(\n\tctx context.Context,\n\tuser, pass string,\n\ttags []string,\n) (\n\tbool,\n\terror,\n)\n```\nVerifies that a user with with the given password exists in the hapassword map, and that the user has all of the tags provided.\n\n```go\ntype Loader interface {\n\t// How long the data in the cache should be kept before its refreshed.\n\tCacheDuration() time.Duration\n\n\t// Fetches the secret from the underlying store.\n\tFetch(context.Context) ([]byte, error)\n\n\t// Returns true if the data in the secret is stale and needs to be\n\t// refreshed before the next use.\n\tIsStale(context.Context) bool\n\n\t// True if the data should be preloaded on startup.\n\tPreLoad(context.Context) bool\n\n\t// True if the data is allowed to be stale.\n\tStale(context.Context) bool\n\n\t// A string representing the URL that was used to load this secret.\n\tURL(context.Context) string\n}\n```\n\n```go\nfunc NewLoader(u string, p Profiles) (Loader, error)\n```\n\n```go\ntype Profiles interface {\n\t// Returns true if a profile has been configured (but perhaps not\n\t// initialized yet). Used for configuration.\n\tCheckProfile(name string) bool\n\n\t// Gets the actual AWS session that will be used for fetching secrets\n\t// if needed.\n\tGetSession(name string) *session.Session\n}\n```\n\n```go\ntype SAMLProvider struct {\n\t// The URL of the Entity MetaData resources.\n\tIDPMetaDataURL string\n\n\t// The IDP URL that is used to direct a caller to a login page\n\t// if needed.\n\tIDPURL string\n\n\t// The URL of the MetaData server for this SAML Service Provider. This\n\t// is the URL that will be used to fetch MetaData resources to manage\n\t// the IDP -\u003e SP relationship.\n\tMetaDataURL string\n\n\t// The URL of the ACS resource for this SAML provider.\n\tACSURL string\n\n\t// The URL of the SLO resource for this SAML resource.\n\tSLOURL string\n\n\t// SAML Provider is a wrapper around the Certificate implementation\n\t// as it uses a certificate's public and private key for SAML\n\t// configuration.\n\tCertificate\n\t// contains filtered or unexported fields\n}\n```\nLoads SAML secrets from the secret sources and provides it as an interface to callers. This will automatically update the provider if the underlying certificate changes so that the caller does not need to be aware of the update.\n\n```go\nfunc (s *SAMLProvider) AuthenticationRequest(\n\tctx context.Context,\n) (\n\t*saml.AuthnRequest,\n\terror,\n)\n```\nMakes an authentication request that can be used against the SAML provider in order to start the authentication process.\n\n```go\nfunc (s *SAMLProvider) MetaData(ctx context.Context) (*saml.EntityDescriptor, error)\n```\nReturns the Meta Data object for this ServicePRovider.\n\n```go\nfunc (s *SAMLProvider) ParseResponse(\n\tctx context.Context,\n\tr *http.Request,\n\tid string,\n) (\n\t*saml.Assertion, error,\n)\n```\nParses a HTTP response received after the user returns from the SAML Identity Provider to ensure that it is valid. This requires a \"id\" string that was generated when the request to authenticate was started and a http.Request object that can be used for form reading.\n\n```go\nfunc (s *SAMLProvider) PreLoad(ctx context.Context) error\n```\nIf the SAML Provider uses a secret URL that is configured to preload then this will automatically load the SAML Provider, otherwise this does nothing and returns nil.\n\n```go\nfunc (s *SAMLProvider) StartRefresher(ctx context.Context)\n```\nStarts a background goroutine that will automatically refresh the SAML ServiceProvider as configured by the parameters in the secret loaders used. This will continue to run until the provided context is canceled.\n\n","path":"github.com/liquidgecka/blobby/httpserver/secretloader","name":"secretloader","synopsis":"","isRedistributable":true}
