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

Commitfd42ee1

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 parent487fa65 commitfd42ee1

File tree

49 files changed

+2149
-298
lines changed

Some content is hidden

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

49 files changed

+2149
-298
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
@@ -1021,7 +1021,7 @@ endif
10211021
TEST_PACKAGES ?= ./...
10221022

10231023
test:
1024-
$(GIT_FLAGS) gotestsum --format standard-quiet$(GOTESTSUM_RETRY_FLAGS) --packages="$(TEST_PACKAGES)" --$(GOTEST_FLAGS)
1024+
$(GIT_FLAGS) gotestsum --format standard-quiet$(GOTESTSUM_RETRY_FLAGS) --packages="$(if$(PACKAGE),$(PACKAGE),$(TEST_PACKAGES))" --$(GOTEST_FLAGS)
10251025
.PHONY: test
10261026

10271027
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
@@ -359,23 +359,34 @@ func TemplateVersionParameterOptionFromPreview(option *previewtypes.ParameterOpt
359359
}
360360
}
361361

362+
// oauth2AppEndpoints generates the OAuth2 endpoints for an app
363+
funcoauth2AppEndpoints(accessURL*url.URL) codersdk.OAuth2AppEndpoints {
364+
return codersdk.OAuth2AppEndpoints{
365+
Authorization:accessURL.ResolveReference(&url.URL{
366+
Path:"/oauth2/authorize",
367+
}).String(),
368+
Token:accessURL.ResolveReference(&url.URL{
369+
Path:"/oauth2/token",
370+
}).String(),
371+
DeviceAuth:accessURL.ResolveReference(&url.URL{
372+
Path:"/oauth2/device",
373+
}).String(),
374+
Revocation:accessURL.ResolveReference(&url.URL{
375+
Path:"/oauth2/revoke",
376+
}).String(),
377+
}
378+
}
379+
362380
funcOAuth2ProviderApp(accessURL*url.URL,dbApp database.OAuth2ProviderApp) codersdk.OAuth2ProviderApp {
363381
return codersdk.OAuth2ProviderApp{
364382
ID:dbApp.ID,
365383
Name:dbApp.Name,
366384
RedirectURIs:dbApp.RedirectUris,
367385
Icon:dbApp.Icon,
368-
Endpoints: codersdk.OAuth2AppEndpoints{
369-
Authorization:accessURL.ResolveReference(&url.URL{
370-
Path:"/oauth2/authorize",
371-
}).String(),
372-
Token:accessURL.ResolveReference(&url.URL{
373-
Path:"/oauth2/token",
374-
}).String(),
375-
DeviceAuth:accessURL.ResolveReference(&url.URL{
376-
Path:"/oauth2/device/authorize",
377-
}).String(),
378-
},
386+
CreatedAt:dbApp.CreatedAt,
387+
GrantTypes:dbApp.GrantTypes,
388+
UserID:dbApp.UserID.UUID,
389+
Endpoints:oauth2AppEndpoints(accessURL),
379390
}
380391
}
381392

@@ -385,6 +396,55 @@ func OAuth2ProviderApps(accessURL *url.URL, dbApps []database.OAuth2ProviderApp)
385396
})
386397
}
387398

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp