(ctx context.Context, db database.Store)
| 44 | } |
| 45 | |
| 46 | func (s AGPLIDPSync) OrganizationSyncSettings(ctx context.Context, db database.Store) (*OrganizationSyncSettings, error) { |
| 47 | // If this logic is ever updated, make sure to update the corresponding |
| 48 | // checkIDPOrgSync in coderd/telemetry/telemetry.go. |
| 49 | rlv := s.Manager.Resolver(db) |
| 50 | orgSettings, err := s.SyncSettings.Organization.Resolve(ctx, rlv) |
| 51 | if err != nil { |
| 52 | if !xerrors.Is(err, runtimeconfig.ErrEntryNotFound) { |
| 53 | return nil, xerrors.Errorf("resolve org sync settings: %w", err) |
| 54 | } |
| 55 | |
| 56 | // Default to the statically assigned settings if they exist. |
| 57 | orgSettings = &OrganizationSyncSettings{ |
| 58 | Field: s.DeploymentSyncSettings.OrganizationField, |
| 59 | Mapping: s.DeploymentSyncSettings.OrganizationMapping, |
| 60 | AssignDefault: s.DeploymentSyncSettings.OrganizationAssignDefault, |
| 61 | } |
| 62 | } |
| 63 | return orgSettings, nil |
| 64 | } |
| 65 | |
| 66 | func (s AGPLIDPSync) ParseOrganizationClaims(_ context.Context, claims jwt.MapClaims) (OrganizationParams, *HTTPError) { |
| 67 | // For AGPL we only sync the default organization. |
no test coverage detected