Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit55ef6ed

Browse files
committed
chore: refactor RegistrationAccessToken from string to []byte
1 parentd1cf114 commit55ef6ed

File tree

13 files changed

+43
-58
lines changed

13 files changed

+43
-58
lines changed

‎coderd/database/dbauthz/dbauthz.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2428,7 +2428,7 @@ func (q *querier) GetOAuth2ProviderAppByID(ctx context.Context, id uuid.UUID) (d
24282428
returnq.db.GetOAuth2ProviderAppByID(ctx,id)
24292429
}
24302430

2431-
func (q*querier)GetOAuth2ProviderAppByRegistrationToken(ctx context.Context,registrationAccessTokensql.NullString) (database.OAuth2ProviderApp,error) {
2431+
func (q*querier)GetOAuth2ProviderAppByRegistrationToken(ctx context.Context,registrationAccessToken[]byte) (database.OAuth2ProviderApp,error) {
24322432
iferr:=q.authorizeContext(ctx,policy.ActionRead,rbac.ResourceOauth2App);err!=nil {
24332433
return database.OAuth2ProviderApp{},err
24342434
}

‎coderd/database/dbgen/dbgen.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ func OAuth2ProviderApp(t testing.TB, db database.Store, seed database.OAuth2Prov
12591259
Jwks:seed.Jwks,// pqtype.NullRawMessage{} is not comparable, use existing value
12601260
SoftwareID:takeFirst(seed.SoftwareID, sql.NullString{}),
12611261
SoftwareVersion:takeFirst(seed.SoftwareVersion, sql.NullString{}),
1262-
RegistrationAccessToken:takeFirst(seed.RegistrationAccessToken, sql.NullString{}),
1262+
RegistrationAccessToken:seed.RegistrationAccessToken,
12631263
RegistrationClientUri:takeFirst(seed.RegistrationClientUri, sql.NullString{}),
12641264
})
12651265
require.NoError(t,err,"insert oauth2 app")

‎coderd/database/dbmetrics/querymetrics.go‎

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/dump.sql‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ALTERTABLE oauth2_provider_apps
2+
ALTER COLUMN registration_access_token
3+
SET DATA TYPEtext
4+
USING encode(registration_access_token,'escape');
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
-- Convert registration_access_token column from text to bytea in oauth2_provider_apps table
3+
-- This feature is in experimental stage, and not currently used outside dogfood.
4+
--
5+
-- The PR alongside this migration makes all the current apps invalid, effectivity breaking them
6+
ALTERTABLE oauth2_provider_apps
7+
ALTER COLUMN registration_access_token
8+
SET DATA TYPEbytea
9+
USING decode(registration_access_token,'escape');

‎coderd/database/models.go‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/querier.go‎

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/queries.sql.go‎

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/oauth2provider/apps.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func CreateApp(db database.Store, accessURL *url.URL, auditor *audit.Auditor, lo
110110
Jwks: pqtype.NullRawMessage{},
111111
SoftwareID: sql.NullString{},
112112
SoftwareVersion: sql.NullString{},
113-
RegistrationAccessToken:sql.NullString{},
113+
RegistrationAccessToken:nil,
114114
RegistrationClientUri: sql.NullString{},
115115
})
116116
iferr!=nil {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp