mirror of
https://github.com/paralus/paralus.git
synced 2026-08-24 15:47:19 +00:00
Update how unique is handled in provider
This commit is contained in:
@@ -25,9 +25,9 @@ ALTER TABLE authsrv_oidc_provider OWNER TO admindbuser;
|
||||
|
||||
ALTER TABLE ONLY authsrv_oidc_provider ADD CONSTRAINT authsrv_oidc_provider_pkey PRIMARY KEY (id);
|
||||
|
||||
ALTER TABLE ONLY authsrv_oidc_provider ADD CONSTRAINT authsrv_oidc_provider_id_name_key UNIQUE (id,name);
|
||||
CREATE UNIQUE index authsrv_oidc_provider_issuer_url ON authsrv_oidc_provider (issuer_url) WHERE trash IS false;
|
||||
|
||||
ALTER TABLE ONLY authsrv_oidc_provider ADD CONSTRAINT authsrv_oidc_provider_issuer_url_key UNIQUE (issuer_url);
|
||||
CREATE UNIQUE index authsrv_oidc_provider_name ON authsrv_oidc_provider (name) WHERE trash IS false;
|
||||
|
||||
CREATE INDEX authsrv_oidc_provider_organization_id_4219d6ee ON authsrv_oidc_provider USING btree (organization_id);
|
||||
|
||||
|
||||
@@ -389,7 +389,9 @@ func (s *oidcProvider) Update(ctx context.Context, provider *systemv3.OIDCProvid
|
||||
}
|
||||
_, err = dao.Update(ctx, s.db, existingP.Id, entity)
|
||||
if err != nil {
|
||||
return &systemv3.OIDCProvider{}, err
|
||||
_log.Errorf("Unable to create oidc provider: %s", err)
|
||||
// TODO: catch already existing issuer url and return exact error
|
||||
return &systemv3.OIDCProvider{}, fmt.Errorf("unable to create oidc provider")
|
||||
}
|
||||
|
||||
rclaims, _ := structpb.NewStruct(entity.RequestedClaims)
|
||||
|
||||
Reference in New Issue
Block a user