mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: implement organization role sync (#14649)
* chore: implement organization and site wide role sync in idpsync * chore: remove old role sync, insert new idpsync package
This commit is contained in:
@@ -46,7 +46,7 @@ func MustNew[T EntryValue](name string) RuntimeEntry[T] {
|
||||
}
|
||||
|
||||
// SetRuntimeValue attempts to update the runtime value of this field in the store via the given Mutator.
|
||||
func (e *RuntimeEntry[T]) SetRuntimeValue(ctx context.Context, m Resolver, val T) error {
|
||||
func (e RuntimeEntry[T]) SetRuntimeValue(ctx context.Context, m Resolver, val T) error {
|
||||
name, err := e.name()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("set runtime: %w", err)
|
||||
@@ -56,7 +56,7 @@ func (e *RuntimeEntry[T]) SetRuntimeValue(ctx context.Context, m Resolver, val T
|
||||
}
|
||||
|
||||
// UnsetRuntimeValue removes the runtime value from the store.
|
||||
func (e *RuntimeEntry[T]) UnsetRuntimeValue(ctx context.Context, m Resolver) error {
|
||||
func (e RuntimeEntry[T]) UnsetRuntimeValue(ctx context.Context, m Resolver) error {
|
||||
name, err := e.name()
|
||||
if err != nil {
|
||||
return xerrors.Errorf("unset runtime: %w", err)
|
||||
@@ -66,7 +66,7 @@ func (e *RuntimeEntry[T]) UnsetRuntimeValue(ctx context.Context, m Resolver) err
|
||||
}
|
||||
|
||||
// Resolve attempts to resolve the runtime value of this field from the store via the given Resolver.
|
||||
func (e *RuntimeEntry[T]) Resolve(ctx context.Context, r Resolver) (T, error) {
|
||||
func (e RuntimeEntry[T]) Resolve(ctx context.Context, r Resolver) (T, error) {
|
||||
var zero T
|
||||
|
||||
name, err := e.name()
|
||||
@@ -87,7 +87,7 @@ func (e *RuntimeEntry[T]) Resolve(ctx context.Context, r Resolver) (T, error) {
|
||||
}
|
||||
|
||||
// name returns the configured name, or fails with ErrNameNotSet.
|
||||
func (e *RuntimeEntry[T]) name() (string, error) {
|
||||
func (e RuntimeEntry[T]) name() (string, error) {
|
||||
if e.n == "" {
|
||||
return "", ErrNameNotSet
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user