mirror of
https://github.com/coder/coder.git
synced 2025-07-09 11:45:56 +00:00
chore: implement organization sync and create idpsync package (#14432)
* chore: implement filters for the organizations query * chore: implement organization sync and create idpsync package Organization sync can now be configured to assign users to an org based on oidc claims.
This commit is contained in:
25
enterprise/coderd/enidpsync/enidpsync.go
Normal file
25
enterprise/coderd/enidpsync/enidpsync.go
Normal file
@ -0,0 +1,25 @@
|
||||
package enidpsync
|
||||
|
||||
import (
|
||||
"cdr.dev/slog"
|
||||
|
||||
"github.com/coder/coder/v2/coderd/entitlements"
|
||||
"github.com/coder/coder/v2/coderd/idpsync"
|
||||
)
|
||||
|
||||
// EnterpriseIDPSync enabled syncing user information from an external IDP.
|
||||
// The sync is an enterprise feature, so this struct wraps the AGPL implementation
|
||||
// and extends it with enterprise capabilities. These capabilities can entirely
|
||||
// be changed in the Parsing, and leaving the "syncing" part (which holds the
|
||||
// more complex logic) to the shared AGPL implementation.
|
||||
type EnterpriseIDPSync struct {
|
||||
entitlements *entitlements.Set
|
||||
*idpsync.AGPLIDPSync
|
||||
}
|
||||
|
||||
func NewSync(logger slog.Logger, set *entitlements.Set, settings idpsync.SyncSettings) *EnterpriseIDPSync {
|
||||
return &EnterpriseIDPSync{
|
||||
entitlements: set,
|
||||
AGPLIDPSync: idpsync.NewAGPLSync(logger.With(slog.F("enterprise_capable", "true")), settings),
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user