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

Commit5f71ebd

Browse files
committed
feat(oauth2): add frontend UI for client credentials applications
- Add ClientCredentialsAppForm and ClientCredentialsAppRow components- Update API schemas to include created_at, grant_types, and user_id fields- Add dedicated pages for creating and managing client credentials apps- Update sidebar navigation and routing for OAuth2 client credentials- Enhance OAuth2AppPageView with user ownership information displayChange-Id: I3271c7fb995d7225dd6cc830066fa2c8cb29720aSigned-off-by: Thomas Kosiewski <tk@coder.com>
1 parentef3c66e commit5f71ebd

File tree

48 files changed

+1977
-279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1977
-279
lines changed

‎.claude/docs/TESTING.md

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,23 @@ coderd/
6262

6363
###Running Tests
6464

65-
| Command| Purpose|
66-
|---------|---------|
67-
|`make test`| Run all Go tests|
68-
|`make test RUN=TestFunctionName`| Run specific test|
69-
|`go test -v ./path/to/package -run TestFunctionName`| Run test with verbose output|
70-
|`make test-postgres`| Run tests with Postgres database|
71-
|`make test-race`| Run tests with Go race detector|
72-
|`make test-e2e`| Run end-to-end tests|
65+
| Command| Purpose|
66+
|------------------------------------------------------|----------------------------------|
67+
|`make test`| Run all Go tests|
68+
|`make test PACKAGE=./pkg/...`| Run tests for specific package|
69+
|`make test RUN=TestFunctionName`| Run specific test|
70+
|`make test PACKAGE=./pkg/... RUN=TestFunctionName`| Run specific test in package|
71+
|`go test -v ./path/to/package -run TestFunctionName`| Run test with verbose output|
72+
|`make test-postgres`| Run tests with Postgres database|
73+
|`make test-race`| Run tests with Go race detector|
74+
|`make test-e2e`| Run end-to-end tests|
7375

7476
###Frontend Testing
7577

76-
| Command| Purpose|
77-
|---------|---------|
78-
|`pnpm test`| Run frontend tests|
79-
|`pnpm check`| Run code checks|
78+
| Command| Purpose|
79+
|--------------|--------------------|
80+
|`pnpm test`| Run frontend tests|
81+
|`pnpm check`| Run code checks|
8082

8183
##Common Testing Issues
8284

@@ -207,6 +209,7 @@ func BenchmarkFunction(b *testing.B) {
207209
```
208210

209211
Run benchmarks with:
212+
210213
```bash
211214
gotest -bench=. -benchmem ./package/path
212215
```

‎.claude/docs/WORKFLOWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,9 @@
104104
###Test Execution
105105

106106
- Run full test suite:`make test`
107+
- Run specific package:`make test PACKAGE=./coderd/oauth2/...`
107108
- Run specific test:`make test RUN=TestFunctionName`
109+
- Run specific test in package:`make test PACKAGE=./coderd/oauth2/... RUN=TestFunctionName`
108110
- Run with Postgres:`make test-postgres`
109111
- Run with race detector:`make test-race`
110112
- Run end-to-end tests:`make test-e2e`

‎CLAUDE.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,21 @@
77

88
##🚀 Essential Commands
99

10-
| Task| Command| Notes|
11-
|-------------------|--------------------------|----------------------------------|
12-
|**Development**|`./scripts/develop.sh`| ⚠️ Don't use manual build|
13-
|**Build**|`make build`| Fat binaries (includes server)|
14-
|**Build Slim**|`make build-slim`| Slim binaries|
15-
|**Test**|`make test`| Full test suite|
16-
|**Test Single**|`make test RUN=TestName`| Faster than full suite|
17-
|**Test Postgres**|`make test-postgres`| Run tests with Postgres database|
18-
|**Test Race**|`make test-race`| Run tests with Go race detector|
19-
|**Lint**|`make lint`| Always run after changes|
20-
|**Generate**|`make gen`| After database changes|
21-
|**Format**|`make fmt`| Auto-format code|
22-
|**Clean**|`make clean`| Clean build artifacts|
10+
| Task| Command| Notes|
11+
|-------------------|--------------------------------------------|----------------------------------|
12+
|**Development**|`./scripts/develop.sh`| ⚠️ Don't use manual build|
13+
|**Build**|`make build`| Fat binaries (includes server)|
14+
|**Build Slim**|`make build-slim`| Slim binaries|
15+
|**Test**|`make test`| Full test suite|
16+
|**Test Package**|`make test PACKAGE=./pkg/...`| Test specific package|
17+
|**Test Single**|`make test RUN=TestName`| Faster than full suite|
18+
|**Test Combined**|`make test PACKAGE=./pkg/... RUN=TestName`| Test specific test in package|
19+
|**Test Postgres**|`make test-postgres`| Run tests with Postgres database|
20+
|**Test Race**|`make test-race`| Run tests with Go race detector|
21+
|**Lint**|`make lint`| Always run after changes|
22+
|**Generate**|`make gen`| After database changes|
23+
|**Format**|`make fmt`| Auto-format code|
24+
|**Clean**|`make clean`| Clean build artifacts|
2325

2426
###Frontend Commands (site directory)
2527

‎Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -936,7 +936,7 @@ GOTESTSUM_RETRY_FLAGS :=
936936
endif
937937

938938
test:
939-
$(GIT_FLAGS) gotestsum --format standard-quiet$(GOTESTSUM_RETRY_FLAGS) --packages="./..." -- -v -short -count=1$(if$(RUN),-run$(RUN))
939+
$(GIT_FLAGS) gotestsum --format standard-quiet$(GOTESTSUM_RETRY_FLAGS) --packages="$(if$(PACKAGE),$(PACKAGE),./...)" -- -v -short -count=1$(if$(RUN),-run$(RUN))
940940
.PHONY: test
941941

942942
test-cli:

‎coderd/apidoc/docs.go

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

‎coderd/apidoc/swagger.json

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

‎coderd/database/db2sdk/db2sdk.go

Lines changed: 71 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -353,23 +353,34 @@ func TemplateVersionParameterOptionFromPreview(option *previewtypes.ParameterOpt
353353
}
354354
}
355355

356+
// oauth2AppEndpoints generates the OAuth2 endpoints for an app
357+
funcoauth2AppEndpoints(accessURL*url.URL) codersdk.OAuth2AppEndpoints {
358+
return codersdk.OAuth2AppEndpoints{
359+
Authorization:accessURL.ResolveReference(&url.URL{
360+
Path:"/oauth2/authorize",
361+
}).String(),
362+
Token:accessURL.ResolveReference(&url.URL{
363+
Path:"/oauth2/token",
364+
}).String(),
365+
DeviceAuth:accessURL.ResolveReference(&url.URL{
366+
Path:"/oauth2/device",
367+
}).String(),
368+
Revocation:accessURL.ResolveReference(&url.URL{
369+
Path:"/oauth2/revoke",
370+
}).String(),
371+
}
372+
}
373+
356374
funcOAuth2ProviderApp(accessURL*url.URL,dbApp database.OAuth2ProviderApp) codersdk.OAuth2ProviderApp {
357375
return codersdk.OAuth2ProviderApp{
358376
ID:dbApp.ID,
359377
Name:dbApp.Name,
360378
RedirectURIs:dbApp.RedirectUris,
361379
Icon:dbApp.Icon,
362-
Endpoints: codersdk.OAuth2AppEndpoints{
363-
Authorization:accessURL.ResolveReference(&url.URL{
364-
Path:"/oauth2/authorize",
365-
}).String(),
366-
Token:accessURL.ResolveReference(&url.URL{
367-
Path:"/oauth2/token",
368-
}).String(),
369-
DeviceAuth:accessURL.ResolveReference(&url.URL{
370-
Path:"/oauth2/device/authorize",
371-
}).String(),
372-
},
380+
CreatedAt:dbApp.CreatedAt,
381+
GrantTypes:dbApp.GrantTypes,
382+
UserID:dbApp.UserID.UUID,
383+
Endpoints:oauth2AppEndpoints(accessURL),
373384
}
374385
}
375386

@@ -379,6 +390,55 @@ func OAuth2ProviderApps(accessURL *url.URL, dbApps []database.OAuth2ProviderApp)
379390
})
380391
}
381392

393+
funcOAuth2ProviderAppRow(accessURL*url.URL,dbApp database.GetOAuth2ProviderAppByIDRow) codersdk.OAuth2ProviderApp {
394+
return codersdk.OAuth2ProviderApp{
395+
ID:dbApp.ID,
396+
Name:dbApp.Name,
397+
RedirectURIs:dbApp.RedirectUris,
398+
Icon:dbApp.Icon,
399+
CreatedAt:dbApp.CreatedAt,
400+
GrantTypes:dbApp.GrantTypes,
401+
UserID:dbApp.UserID.UUID,
402+
Username:dbApp.Username.String,
403+
Email:dbApp.Email.String,
404+
Endpoints:oauth2AppEndpoints(accessURL),
405+
}
406+
}
407+
408+
funcOAuth2ProviderAppsRows(accessURL*url.URL,dbApps []database.GetOAuth2ProviderAppsRow) []codersdk.OAuth2ProviderApp {
409+
returnList(dbApps,func(dbApp database.GetOAuth2ProviderAppsRow) codersdk.OAuth2ProviderApp {
410+
return codersdk.OAuth2ProviderApp{
411+
ID:dbApp.ID,
412+
Name:dbApp.Name,
413+
RedirectURIs:dbApp.RedirectUris,
414+
Icon:dbApp.Icon,
415+
CreatedAt:dbApp.CreatedAt,
416+
GrantTypes:dbApp.GrantTypes,
417+
UserID:dbApp.UserID.UUID,
418+
Username:dbApp.Username.String,
419+
Email:dbApp.Email.String,
420+
Endpoints:oauth2AppEndpoints(accessURL),
421+
}
422+
})
423+
}
424+
425+
funcOAuth2ProviderAppsByOwnerIDRows(accessURL*url.URL,dbApps []database.GetOAuth2ProviderAppsByOwnerIDRow) []codersdk.OAuth2ProviderApp {
426+
returnList(dbApps,func(dbApp database.GetOAuth2ProviderAppsByOwnerIDRow) codersdk.OAuth2ProviderApp {
427+
return codersdk.OAuth2ProviderApp{
428+
ID:dbApp.ID,
429+
Name:dbApp.Name,
430+
RedirectURIs:dbApp.RedirectUris,
431+
Icon:dbApp.Icon,
432+
CreatedAt:dbApp.CreatedAt,
433+
GrantTypes:dbApp.GrantTypes,
434+
UserID:dbApp.UserID.UUID,
435+
Username:dbApp.Username.String,
436+
Email:dbApp.Email.String,
437+
Endpoints:oauth2AppEndpoints(accessURL),
438+
}
439+
})
440+
}
441+
382442
funcconvertDisplayApps(apps []database.DisplayApp) []codersdk.DisplayApp {
383443
dapps:=make([]codersdk.DisplayApp,0,len(apps))
384444
for_,app:=rangeapps {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp