-
Notifications
You must be signed in to change notification settings - Fork 1
Team Viewer Role & RBAC Improvements #308
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
thokra-nav
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approver for å gjøre graphql review grønn, men se over kommentarene
| -- name: UserIsMember :one | ||
| -- name: ViewerIsMember :one | ||
| SELECT | ||
| EXISTS ( | ||
| SELECT | ||
| id | ||
| FROM | ||
| user_roles | ||
| WHERE | ||
| user_id = @user_id | ||
| AND target_team_slug = @team_slug::slug | ||
| AND role_name IN ('Team member', 'Team owner') | ||
| ) | ||
| ; | ||
|
|
||
| -- name: UserIsOwner :one |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Synes vi kan fortsette å kalle disse UserIs..
internal/team/queries.go
Outdated
| func ViewerIsOwner(ctx context.Context, teamSlug slug.Slug, userID uuid.UUID) (bool, error) { | ||
| return db(ctx).ViewerIsOwner(ctx, teamsql.ViewerIsOwnerParams{ | ||
| UserID: userID, | ||
| TeamSlug: teamSlug, | ||
| }) | ||
| } | ||
|
|
||
| func UserIsMember(ctx context.Context, teamSlug slug.Slug, userID uuid.UUID) (bool, error) { | ||
| return db(ctx).UserIsMember(ctx, teamsql.UserIsMemberParams{ | ||
| func ViewerIsMember(ctx context.Context, teamSlug slug.Slug, userID uuid.UUID) (bool, error) { | ||
| return db(ctx).ViewerIsMember(ctx, teamsql.ViewerIsMemberParams{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Her også, bedre å beholde UserIs... navnene
Co-authored-by: Johnny Horvi <johnny@horvi.no>
Co-authored-by: Johnny Horvi <johnny@horvi.no>
Changed from RFC3339 annotation to Unix timestamp label for consistency with naiserator webhook and euthanaisa.
Refactor secret loader to use impersonated clients for all operations. Remove ServiceAccountClientCreator and related methods. Update secret queries to use watcher.ImpersonatedClient and watcher.Delete.
3917955 to
4e3e41d
Compare
Key Changes
🔑 Secret Metadata Without Elevation
Secret.keysfield to expose key names without requiring elevation🔄 Secret Client Refactoring
ServiceAccountClientCreatorabstractionSystemAuthenticatedClient(service account)ImpersonatedClient(user elevation)🧹 Cleanup