Move Vercel /v2/user fetch to pkg/connector/vercel.go → Migrate connector settings callers to generic
- Move Vercel /v2/user fetch to pkg/connector/vercel.go - Authorize NeedsConfiguration and SelectedOrganization - Add coredata.ConnectorSettings[T] generic helper - Migrate connector settings callers to generic Signed-off-by: Aurélien Sibiril <81782+aureliensibiril@users.noreply.github.com>
This commit is contained in:
@@ -469,6 +469,10 @@ func (r *accessSourceResolver) ProviderOrganizations(ctx context.Context, obj *t
|
||||
|
||||
// NeedsConfiguration is the resolver for the needsConfiguration field.
|
||||
func (r *accessSourceResolver) NeedsConfiguration(ctx context.Context, obj *types.AccessSource) (bool, error) {
|
||||
if err := r.authorize(ctx, obj.ID, probo.ActionAccessSourceGet); err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
if obj.ConnectorID == nil {
|
||||
return false, nil
|
||||
}
|
||||
@@ -560,6 +564,10 @@ func (r *accessSourceResolver) ConnectionStatus(ctx context.Context, obj *types.
|
||||
|
||||
// SelectedOrganization is the resolver for the selectedOrganization field.
|
||||
func (r *accessSourceResolver) SelectedOrganization(ctx context.Context, obj *types.AccessSource) (*string, error) {
|
||||
if err := r.authorize(ctx, obj.ID, probo.ActionAccessSourceGet); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if obj.ConnectorID == nil {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user