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 patch and get api methods for role sync#14692

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

Merged
Emyrk merged 2 commits intomainfromstevenmasley/role_sync_crud
Sep 17, 2024

Conversation

@Emyrk
Copy link
Member

No description provided.

@EmyrkEmyrk requested a review fromf0sselSeptember 16, 2024 21:02
Base automatically changed fromstevenmasley/org_role_sync tomainSeptember 17, 2024 00:03
@EmyrkEmyrkforce-pushed thestevenmasley/role_sync_crud branch from4a7bfcf to2c9420dCompareSeptember 17, 2024 00:08
// Mapping maps from an OIDC group --> Coder organization role
Mappingmap[string][]string`json:"mapping"`
}
typeRoleSyncSettings codersdk.RoleSyncSettings
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I see why we alias (I think that's the correct terminology?) to add the additional methods, but I wonder if we could just implement those on the codersdk type? Or would that then be a dependency issue? It would just be nice to have a single type if possible, but not required.

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

@f0ssel techincally it's a type definition.

Aliasing istype RoleSyncSettings = codersdk.RoleSyncSettings. If you alias, it means the types are equivalent, and the alias is essentially replaced with the source at compile time. With a type definition, you create a new type.

I agree the aliasing is a bit strange. It exists because of an import cycle, and it also made sense to export via CoderSDK since the UI needs to consume it.

It felt strange for theidpsync package to not fully self contain it's own types. It is strange it depends on codersdk, but it is a consequence of our import cycles and not wanting to copy + paste a struct definition.

Ideallycodersdk would type alias of the theidpsync.

Maybe we can change this in the future, I just didn't spend a ton of time on this. Kayla implemented this idea first, and it felt good enough to me for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yeah the import cycle is the nail in the coffin then, no worries this is still good.

r.Group(func(r chi.Router) {
r.Use(
apiKeyMiddleware,
httpmw.ExtractOrganizationParam(api.Database),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Will this break any existing usages?

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Nope, it makes it more permissive, rather then restrictive. So it used to be gated by our experiment and premium licensing, but sync is an enterprise feature.

It makes sense to allow even single org deployments to configure this at runtime, so I dropped the entitlement requirements.

There is an entitlement check on the actual sync code, so tbd if we should also gate thepatch endpoint, or just defer to some warning like "These settings require enterprise to function".

return
}

//nolint:gocritic // Requires system context to update runtime config
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Can we change this to let org admins change this value? If this is a user action it feels weird to drop into system here. We usually just do that for non-user actors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Follow up would be fine

Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Yes, I do want to. Just with the timelines, I did this as a stop gap.

I want to solve RBAC and runtime config fields in a more general reusable pattern. Until then, I just require a system context. And I use a system context so no one else can use these sync settings incorrectly. The dbauthz layer is currently pretty strict, and when this is fixed, we will make it more permissive. Always an easier way to move forward then the other way around.

@EmyrkEmyrk merged commitce21b20 intomainSep 17, 2024
@EmyrkEmyrk deleted the stevenmasley/role_sync_crud branchSeptember 17, 2024 15:38
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 17, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@f0sself0sself0ssel approved these changes

Assignees

@EmyrkEmyrk

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@Emyrk@f0ssel

[8]ページ先頭

©2009-2025 Movatter.jp