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

feat: implement custom site-wide roles in the database#13289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Emyrk wants to merge26 commits intomainfromstevenmasley/custom_site_roles
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
26 commits
Select commitHold shift + click to select a range
5640dc8
chore: add migration to create a custom_roles table
EmyrkMay 15, 2024
60274ad
add custom role expansion from db
EmyrkMay 15, 2024
863f477
commit back querier.go, whoops!
EmyrkMay 15, 2024
27e90cd
Add route to insert new roles
EmyrkMay 15, 2024
3ad641c
adding esclation and validation checks on custom roles
EmyrkMay 15, 2024
e0b7070
add test for custom roles
EmyrkMay 16, 2024
5eaf6b0
add comment
EmyrkMay 16, 2024
8fb8a1b
add dbauthz test
EmyrkMay 16, 2024
8107dc7
add custom role esclation tests
EmyrkMay 16, 2024
f5cd901
add built in role validation tests
EmyrkMay 16, 2024
ce87f77
add test comment
EmyrkMay 16, 2024
d41e95a
update comment
EmyrkMay 16, 2024
171dbf0
cleanup
EmyrkMay 16, 2024
52e097c
fixup rolename expansion
EmyrkMay 16, 2024
71db49d
fmt
EmyrkMay 16, 2024
1c6939e
add db fixture
EmyrkMay 16, 2024
ea9b9be
typo
EmyrkMay 16, 2024
aa85df1
Make gen
EmyrkMay 16, 2024
2b0cba6
thread safe role cache'
EmyrkMay 16, 2024
0d91366
More lint
EmyrkMay 16, 2024
06a17c1
graphite pulled code from another branch??
EmyrkMay 16, 2024
8ccf30c
unsure how to nolint this use of the owner
EmyrkMay 16, 2024
490e9d9
fix gen
EmyrkMay 16, 2024
1eec6e2
fmt.Errorf to xerrors
EmyrkMay 16, 2024
5803346
fix imports
EmyrkMay 16, 2024
3c8f79f
add import
EmyrkMay 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 82 additions & 5 deletionscoderd/apidoc/docs.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

87 changes: 82 additions & 5 deletionscoderd/apidoc/swagger.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

4 changes: 2 additions & 2 deletionscoderd/audit.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -196,12 +196,12 @@ func (api *API) convertAuditLog(ctx context.Context, dblog database.GetAuditLogs
CreatedAt: dblog.UserCreatedAt.Time,
Status: codersdk.UserStatus(dblog.UserStatus.UserStatus),
},
Roles: []codersdk.Role{},
Roles: []codersdk.SlimRole{},
}

for _, roleName := range dblog.UserRoles {
rbacRole, _ := rbac.RoleByName(roleName)
user.Roles = append(user.Roles, db2sdk.Role(rbacRole))
user.Roles = append(user.Roles, db2sdk.SlimRole(rbacRole))
}
}

Expand Down
2 changes: 2 additions & 0 deletionscoderd/coderd.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,6 +61,7 @@ import (
"github.com/coder/coder/v2/coderd/provisionerdserver"
"github.com/coder/coder/v2/coderd/rbac"
"github.com/coder/coder/v2/coderd/rbac/policy"
"github.com/coder/coder/v2/coderd/rbac/rolestore"
"github.com/coder/coder/v2/coderd/schedule"
"github.com/coder/coder/v2/coderd/telemetry"
"github.com/coder/coder/v2/coderd/tracing"
Expand DownExpand Up@@ -631,6 +632,7 @@ func New(options *Options) *API {
httpmw.AttachRequestID,
httpmw.ExtractRealIP(api.RealIPConfig),
httpmw.Logger(api.Logger),
rolestore.CustomRoleMW,
prometheusMW,
// Build-Version is helpful for debugging.
func(next http.Handler) http.Handler {
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp