coder / coder

Provision remote development environments via Terraform
https://coder.com
GNU Affero General Public License v3.0
7.9k stars 661 forks source link

Group sync API + CLI CRUD #14626

Closed Emyrk closed 3 hours ago

Emyrk commented 1 week ago

Implement api interface for group sync settings crud. Group sync settings are now configured in the database and mutable at runtime.

Requires api endpoint to set and read the group sync runtime settings.

The code to interact with the settings from an api handler:

    settings := api.IDPSync.GroupSyncSettings()
    rlv := api.Options.RuntimeConfig.OrganizationResolver(db, org.ID)
    err := settings.SetRuntimeValue(ctx, rlv, &idpsync.GroupSyncSettings{
        // Values
    })

The problem we currently have is the RBAC story is not fully fleshed out. The current authz call is ResourceSystem: https://github.com/coder/coder/blob/1995c13217f4ccf4fd63ee5b0605588e16d49984/coderd/database/dbauthz/dbauthz.go#L3939-L3944

aslilac commented 6 days ago

Requires https://github.com/coder/coder/pull/14578

Kira-Pilot commented 3 hours ago

@Emyrk I think we wrapped this up so closing! Feel free to re-open if I'm mistaken!