Replace trust center alias with resource alias in console API

Drop the setTrustCenterAlias and removeTrustCenterAlias mutations and
the alias field on Audit in favor of generic setResourceAlias and
removeResourceAlias mutations backed by the resourcealias service.

Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-06-22 10:59:04 +02:00
parent 9b0a5745a0
commit 231f7d153e
11 changed files with 123 additions and 157 deletions

View File

@@ -173,22 +173,6 @@ func (r *auditResolver) Findings(ctx context.Context, obj *types.Audit, first *i
return types.NewFindingConnection(p, r, obj.ID, filter), nil
}
// Alias is the resolver for the alias field.
func (r *auditResolver) Alias(ctx context.Context, obj *types.Audit) (*string, error) {
scope, err := r.authorize(ctx, obj.ID, probo.ActionAuditGet)
if err != nil {
return nil, err
}
alias, err := r.probo.TrustCenterAliases.GetByResourceID(ctx, scope, obj.ID)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot get audit alias", log.Error(err))
return nil, gqlutils.Internal(ctx)
}
return alias, nil
}
// Permission is the resolver for the permission field.
func (r *auditResolver) Permission(ctx context.Context, obj *types.Audit, action string) (bool, error) {
return r.Resolver.Permission(ctx, obj, action)