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

Function idSecret

coderd/cryptokeys/cache.go:223–230  ·  view source on GitHub ↗
(k codersdk.CryptoKey)

Source from the content-addressed store, hash-verified

221}
222
223func idSecret(k codersdk.CryptoKey) (string, []byte, error) {
224 key, err := hex.DecodeString(k.Secret)
225 if err != nil {
226 return "", nil, xerrors.Errorf("decode key: %w", err)
227 }
228
229 return strconv.FormatInt(int64(k.Sequence), 10), key, nil
230}
231
232func (c *cache) cryptoKey(ctx context.Context, sequence int32) (string, []byte, error) {
233 c.logger.Debug(ctx, "request for key", slog.F("sequence", sequence))

Callers 1

checkKeyFunction · 0.85

Calls 2

DecodeStringMethod · 0.80
ErrorfMethod · 0.45

Tested by

no test coverage detected