(ctx context.Context, id string)
| 160 | } |
| 161 | |
| 162 | func (c *cache) DecryptingKey(ctx context.Context, id string) (interface{}, error) { |
| 163 | if !isEncryptionKeyFeature(c.feature) { |
| 164 | return nil, ErrInvalidFeature |
| 165 | } |
| 166 | |
| 167 | seq, err := strconv.ParseInt(id, 10, 32) |
| 168 | if err != nil { |
| 169 | return nil, xerrors.Errorf("parse id: %w", err) |
| 170 | } |
| 171 | |
| 172 | //nolint:gocritic // cache can only read crypto keys. |
| 173 | ctx = dbauthz.AsKeyReader(ctx) |
| 174 | _, secret, err := c.cryptoKey(ctx, int32(seq)) |
| 175 | if err != nil { |
| 176 | return nil, xerrors.Errorf("crypto key: %w", err) |
| 177 | } |
| 178 | return secret, nil |
| 179 | } |
| 180 | |
| 181 | func (c *cache) SigningKey(ctx context.Context) (string, interface{}, error) { |
| 182 | if !isSigningKeyFeature(c.feature) { |
nothing calls this directly
no test coverage detected