Skip to content

Commit e7cfb46

Browse files
committed
Refactor cryptokeys comments and variable typo
Adjust comments to accurately describe cache functionality and fix a typo in the `New` function parameters for clarity.
1 parent c656d00 commit e7cfb46

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

coderd/coderd.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,9 +683,9 @@ func New(options *Options) *API {
683683
AgentProvider: api.agentProvider,
684684
StatsCollector: workspaceapps.NewStatsCollector(options.WorkspaceAppsStatsCollectorOptions),
685685

686-
DisablePathApps: options.DeploymentValues.DisablePathApps.Value(),
687-
SecureAuthCookie: options.DeploymentValues.SecureAuthCookie.Value(),
688-
APIKeyEncryptionKey: options.AppEncryptionKeyCache,
686+
DisablePathApps: options.DeploymentValues.DisablePathApps.Value(),
687+
SecureAuthCookie: options.DeploymentValues.SecureAuthCookie.Value(),
688+
APIKeyEncryptionKeycache: options.AppEncryptionKeyCache,
689689
}
690690

691691
apiKeyMiddleware := httpmw.ExtractAPIKeyMW(httpmw.ExtractAPIKeyConfig{

coderd/cryptokeys/cache.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func (c *cache) EncryptingKey(ctx context.Context) (string, interface{}, error)
155155
return "", nil, ErrInvalidFeature
156156
}
157157

158-
//nolint:gocritic // cache can only rotate crypto keys.
158+
//nolint:gocritic // cache can only read crypto keys.
159159
ctx = dbauthz.AsKeyReader(ctx)
160160
return c.cryptoKey(ctx, latestSequence)
161161
}
@@ -170,7 +170,7 @@ func (c *cache) DecryptingKey(ctx context.Context, id string) (interface{}, erro
170170
return nil, xerrors.Errorf("parse id: %w", err)
171171
}
172172

173-
//nolint:gocritic // cache can only rotate crypto keys.
173+
//nolint:gocritic // cache can only read crypto keys.
174174
ctx = dbauthz.AsKeyReader(ctx)
175175
_, secret, err := c.cryptoKey(ctx, int32(seq))
176176
if err != nil {
@@ -184,7 +184,7 @@ func (c *cache) SigningKey(ctx context.Context) (string, interface{}, error) {
184184
return "", nil, ErrInvalidFeature
185185
}
186186

187-
//nolint:gocritic // cache can only rotate crypto keys.
187+
//nolint:gocritic // cache can only read crypto keys.
188188
ctx = dbauthz.AsKeyReader(ctx)
189189
return c.cryptoKey(ctx, latestSequence)
190190
}
@@ -204,7 +204,7 @@ func (c *cache) VerifyingKey(ctx context.Context, id string) (interface{}, error
204204
return nil, xerrors.Errorf("crypto key: %w", err)
205205
}
206206

207-
//nolint:gocritic // cache can only rotate crypto keys.
207+
//nolint:gocritic // cache can only read crypto keys.
208208
ctx = dbauthz.AsKeyReader(ctx)
209209
return secret, nil
210210
}

0 commit comments

Comments
 (0)