Skip to content

Commit c5c74d1

Browse files
committed
Appeasing the linter
Signed-off-by: Danny Kopping <danny@coder.com>
1 parent 7e404b0 commit c5c74d1

File tree

7 files changed

+20
-13
lines changed

7 files changed

+20
-13
lines changed

coderd/database/dbgen/dbgen.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ func WorkspaceApp(t testing.TB, db database.Store, orig database.WorkspaceApp) d
618618
Health: takeFirst(orig.Health, database.WorkspaceAppHealthHealthy),
619619
DisplayOrder: takeFirst(orig.DisplayOrder, 1),
620620
Hidden: orig.Hidden,
621+
CORSBehavior: takeFirst(orig.CORSBehavior, database.AppCorsBehaviorSimple),
621622
})
622623
require.NoError(t, err, "insert app")
623624
return resource

coderd/database/dbmem/dbmem.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8154,6 +8154,10 @@ func (q *FakeQuerier) InsertWorkspaceApp(_ context.Context, arg database.InsertW
81548154
arg.SharingLevel = database.AppSharingLevelOwner
81558155
}
81568156

8157+
if arg.CORSBehavior == "" {
8158+
arg.CORSBehavior = database.AppCorsBehaviorSimple
8159+
}
8160+
81578161
// nolint:gosimple
81588162
workspaceApp := database.WorkspaceApp{
81598163
ID: arg.ID,

coderd/workspaceapps/apptest/setup.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ import (
3232
)
3333

3434
const (
35-
proxyTestAgentName = "agent-name"
36-
proxyTestAppNameFake = "test-app-fake"
37-
proxyTestAppNameOwner = "test-app-owner"
38-
proxyTestAppNameAuthenticated = "test-app-authenticated"
39-
proxyTestAppNamePublic = "test-app-public"
35+
proxyTestAgentName = "agent-name"
36+
proxyTestAppNameFake = "test-app-fake"
37+
proxyTestAppNameOwner = "test-app-owner"
38+
proxyTestAppNameAuthenticated = "test-app-authenticated"
39+
proxyTestAppNamePublic = "test-app-public"
40+
// nolint:gosec // Not a secret
4041
proxyTestAppNameAuthenticatedCORSPassthru = "test-app-authenticated-cors-passthru"
4142
proxyTestAppNamePublicCORSPassthru = "test-app-public-cors-passthru"
4243
proxyTestAppNameAuthenticatedCORSDefault = "test-app-authenticated-cors-default"

coderd/workspaceapps/db_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,11 +280,12 @@ func Test_ResolveRequest(t *testing.T) {
280280
RegisteredClaims: jwtutils.RegisteredClaims{
281281
Expiry: jwt.NewNumericDate(token.Expiry.Time()),
282282
},
283-
Request: req,
284-
UserID: me.ID,
285-
WorkspaceID: workspace.ID,
286-
AgentID: agentID,
287-
AppURL: appURL,
283+
Request: req,
284+
UserID: me.ID,
285+
WorkspaceID: workspace.ID,
286+
AgentID: agentID,
287+
AppURL: appURL,
288+
CORSBehavior: token.CORSBehavior,
288289
}, token)
289290
require.NotZero(t, token.Expiry)
290291
require.WithinDuration(t, time.Now().Add(workspaceapps.DefaultTokenExpiry), token.Expiry.Time(), time.Minute)

provisioner/terraform/resources.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ func ConvertState(ctx context.Context, modules []*tfjson.StateModule, rawGraph s
439439
corsBehavior = proto.AppCORSBehavior_PASSTHRU
440440
default:
441441
corsBehavior = proto.AppCORSBehavior_SIMPLE
442-
logger.Debug(ctx, "CORS behavior not set, defaulting to 'simple'")
442+
logger.Debug(ctx, "cors_behavior not set, defaulting to 'simple'", slog.F("address", convertAddressToLabel(resource.Address)))
443443
}
444444

445445
for _, agents := range resourceAgents {

provisionersdk/proto/provisioner.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

provisionersdk/proto/provisioner_drpc.pb.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy