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

Commit4efb07a

Browse files
committed
feat(oauth2): remove unique constraint on app names for RFC 7591 compliance
Change-Id: Iae7a1a06546fbc8de541a52e291f8a4510d57e8aSigned-off-by: Thomas Kosiewski <tk@coder.com>
1 parent58b076d commit4efb07a

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

‎coderd/database/dbmem/dbmem.go‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8971,12 +8971,6 @@ func (q *FakeQuerier) InsertOAuth2ProviderApp(_ context.Context, arg database.In
89718971
q.mutex.Lock()
89728972
deferq.mutex.Unlock()
89738973

8974-
for_,app:=rangeq.oauth2ProviderApps {
8975-
ifapp.Name==arg.Name {
8976-
return database.OAuth2ProviderApp{},errUniqueConstraint
8977-
}
8978-
}
8979-
89808974
//nolint:gosimple // Go wants database.OAuth2ProviderApp(arg), but we cannot be sure the structs will remain identical.
89818975
app:= database.OAuth2ProviderApp{
89828976
ID:arg.ID,

‎coderd/database/dump.sql‎

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-- Restore unique constraint on oauth2_provider_apps.name for rollback
2+
-- Note: This rollback may fail if duplicate names exist in the database
3+
ALTERTABLE oauth2_provider_apps ADDCONSTRAINT oauth2_provider_apps_name_key UNIQUE (name);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-- Remove unique constraint on oauth2_provider_apps.name to comply with RFC 7591
2+
-- RFC 7591 does not require unique client names, only unique client IDs
3+
ALTERTABLE oauth2_provider_apps DROPCONSTRAINT oauth2_provider_apps_name_key;

‎coderd/database/unique_constraint.go‎

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp