Skip to content

Commit ec3bac6

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

File tree

8 files changed

+21
-13
lines changed

8 files changed

+21
-13
lines changed

coderd/database/dbauthz/dbauthz_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -2567,6 +2567,7 @@ func (s *MethodTestSuite) TestSystemFunctions() {
25672567
ID: uuid.New(),
25682568
Health: database.WorkspaceAppHealthDisabled,
25692569
SharingLevel: database.AppSharingLevelOwner,
2570+
CORSBehavior: database.AppCorsBehaviorSimple,
25702571
}).Asserts(rbac.ResourceSystem, policy.ActionCreate)
25712572
}))
25722573
s.Run("InsertWorkspaceResourceMetadata", s.Subtest(func(db database.Store, check *expects) {

coderd/database/dbgen/dbgen.go

+1
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

+4
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

+6-5
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

+6-5
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

+1-1
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

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

provisionersdk/proto/provisioner_drpc.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)