MCPcopy Index your code
hub / github.com/coder/coder / NewSigningCache

Function NewSigningCache

coderd/cryptokeys/cache.go:106–114  ·  view source on GitHub ↗

NewSigningCache instantiates a cache. Close should be called to release resources associated with its internal timer.

(ctx context.Context, logger slog.Logger, fetcher Fetcher,
	feature codersdk.CryptoKeyFeature, opts ...func(*cache),
)

Source from the content-addressed store, hash-verified

104// NewSigningCache instantiates a cache. Close should be called to release resources
105// associated with its internal timer.
106func NewSigningCache(ctx context.Context, logger slog.Logger, fetcher Fetcher,
107 feature codersdk.CryptoKeyFeature, opts ...func(*cache),
108) (SigningKeycache, error) {
109 if !isSigningKeyFeature(feature) {
110 return nil, xerrors.Errorf("invalid feature: %s", feature)
111 }
112 logger = logger.Named(fmt.Sprintf("%s_signing_keycache", feature))
113 return newCache(ctx, logger, fetcher, feature, opts...), nil
114}
115
116func NewEncryptionCache(ctx context.Context, logger slog.Logger, fetcher Fetcher,
117 feature codersdk.CryptoKeyFeature, opts ...func(*cache),

Callers 5

NewFunction · 0.92
TestUserOIDCFunction · 0.92
TestJWSFunction · 0.92
TestCryptoKeyCacheFunction · 0.92
NewFunction · 0.92

Calls 4

isSigningKeyFeatureFunction · 0.85
newCacheFunction · 0.85
NamedMethod · 0.80
ErrorfMethod · 0.45

Tested by 3

TestUserOIDCFunction · 0.74
TestJWSFunction · 0.74
TestCryptoKeyCacheFunction · 0.74