Add oidcapp clientsecretname
[ZITADOPER-1]
This commit is contained in:
@@ -143,6 +143,10 @@ func (d *OIDCApp) Project(ctx context.Context, refresolver *RefResolver) (*Proje
|
|||||||
return project, nil
|
return project, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *OIDCApp) ClientSecretName() string {
|
||||||
|
return d.Name + "-client-secret"
|
||||||
|
}
|
||||||
|
|
||||||
//+kubebuilder:object:root=true
|
//+kubebuilder:object:root=true
|
||||||
|
|
||||||
// OIDCAppList contains a list of OIDCApp
|
// OIDCAppList contains a list of OIDCApp
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ func (wr *wrappedOIDCAppReconciler) Reconcile(ctx context.Context, ztdClient *ma
|
|||||||
for _, r := range wr.OIDCApp.Spec.GrantTypes {
|
for _, r := range wr.OIDCApp.Spec.GrantTypes {
|
||||||
grantTypes = append(grantTypes, app.OIDCGrantType(app.OIDCGrantType_value[string(r)]))
|
grantTypes = append(grantTypes, app.OIDCGrantType(app.OIDCGrantType_value[string(r)]))
|
||||||
}
|
}
|
||||||
|
|
||||||
if wr.OIDCApp.Status.AppId != "" {
|
if wr.OIDCApp.Status.AppId != "" {
|
||||||
appResp, err := ztdClient.GetAppByID(middleware.SetOrgID(ctx, org.Status.OrgId), &pb.GetAppByIDRequest{
|
appResp, err := ztdClient.GetAppByID(middleware.SetOrgID(ctx, org.Status.OrgId), &pb.GetAppByIDRequest{
|
||||||
ProjectId: project.Status.ProjectId,
|
ProjectId: project.Status.ProjectId,
|
||||||
@@ -180,7 +181,7 @@ func (wr *wrappedOIDCAppReconciler) Reconcile(ctx context.Context, ztdClient *ma
|
|||||||
return fmt.Errorf("error creating OIDCApp in Zitadel: %v", err)
|
return fmt.Errorf("error creating OIDCApp in Zitadel: %v", err)
|
||||||
}
|
}
|
||||||
key := types.NamespacedName{
|
key := types.NamespacedName{
|
||||||
Name: wr.OIDCApp.Name + "-client-secret",
|
Name: wr.OIDCApp.ClientSecretName(),
|
||||||
Namespace: wr.OIDCApp.Namespace,
|
Namespace: wr.OIDCApp.Namespace,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user