Skip to content

Commit b2e9c6d

Browse files
committed
wip 2
Signed-off-by: Callum Styan <callumstyan@gmail.com>
1 parent 94e423b commit b2e9c6d

File tree

21 files changed

+259
-42
lines changed

21 files changed

+259
-42
lines changed

coderd/apidoc/docs.go

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbgen/dbgen.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ func Template(t testing.TB, db database.Store, seed database.Template) database.
101101
AllowUserCancelWorkspaceJobs: seed.AllowUserCancelWorkspaceJobs,
102102
MaxPortSharingLevel: takeFirst(seed.MaxPortSharingLevel, database.AppSharingLevelOwner),
103103
UseClassicParameterFlow: takeFirst(seed.UseClassicParameterFlow, true),
104+
CorsBehavior: takeFirst(seed.CorsBehavior, database.CorsBehaviorSimple),
104105
})
105106
require.NoError(t, err, "insert template")
106107

coderd/database/dbmem/dbmem.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9443,6 +9443,7 @@ func (q *FakeQuerier) InsertTemplate(_ context.Context, arg database.InsertTempl
94439443
AllowUserAutostop: true,
94449444
MaxPortSharingLevel: arg.MaxPortSharingLevel,
94459445
UseClassicParameterFlow: arg.UseClassicParameterFlow,
9446+
CorsBehavior: arg.CorsBehavior,
94469447
}
94479448
q.templates = append(q.templates, template)
94489449
return nil
@@ -11353,6 +11354,7 @@ func (q *FakeQuerier) UpdateTemplateMetaByID(_ context.Context, arg database.Upd
1135311354
tpl.AllowUserCancelWorkspaceJobs = arg.AllowUserCancelWorkspaceJobs
1135411355
tpl.MaxPortSharingLevel = arg.MaxPortSharingLevel
1135511356
tpl.UseClassicParameterFlow = arg.UseClassicParameterFlow
11357+
tpl.CorsBehavior = arg.CorsBehavior
1135611358
q.templates[idx] = tpl
1135711359
return nil
1135811360
}

coderd/database/dump.sql

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

coderd/database/migrations/000347_template_level_cors.up.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CREATE TYPE app_cors_behavior AS ENUM (
1+
CREATE TYPE cors_behavior AS ENUM (
22
'simple',
33
'passthru'
44
);

coderd/database/modelqueries.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ func (q *sqlQuerier) GetAuthorizedTemplates(ctx context.Context, arg GetTemplate
119119
&i.ActivityBump,
120120
&i.MaxPortSharingLevel,
121121
&i.UseClassicParameterFlow,
122+
&i.CorsBehavior,
122123
&i.CreatedByAvatarURL,
123124
&i.CreatedByUsername,
124125
&i.CreatedByName,

coderd/database/models.go

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

coderd/database/queries.sql.go

Lines changed: 18 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/templates.sql

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,11 @@ INSERT INTO
9999
display_name,
100100
allow_user_cancel_workspace_jobs,
101101
max_port_sharing_level,
102-
use_classic_parameter_flow
102+
use_classic_parameter_flow,
103+
cors_behavior
103104
)
104105
VALUES
105-
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16);
106+
($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17);
106107

107108
-- name: UpdateTemplateActiveVersionByID :exec
108109
UPDATE
@@ -134,7 +135,8 @@ SET
134135
allow_user_cancel_workspace_jobs = $7,
135136
group_acl = $8,
136137
max_port_sharing_level = $9,
137-
use_classic_parameter_flow = $10
138+
use_classic_parameter_flow = $10,
139+
cors_behavior = $11
138140
WHERE
139141
id = $1
140142
;

0 commit comments

Comments
 (0)