mirror of
https://github.com/andwati/zitadel.git
synced 2026-12-01 08:28:51 +00:00
fix(console): app details (#7827)
* cleanup app urls * fix app details * styles and specific urls * lint * explicit urls * deterministic order * lint --------- Co-authored-by: Max Peintner <[email protected]>
This commit is contained in:
co-authored by
Max Peintner
parent
6ab06aa249
commit
8c1a8f792a
@@ -8,7 +8,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { Buffer } from 'buffer';
|
||||
import { Duration } from 'google-protobuf/google/protobuf/duration_pb';
|
||||
import { Subject, Subscription } from 'rxjs';
|
||||
import { mergeMap, Subject, Subscription } from 'rxjs';
|
||||
import { map, take } from 'rxjs/operators';
|
||||
import { RadioItemAuthType } from 'src/app/modules/app-radio/app-auth-method-radio/app-auth-method-radio.component';
|
||||
import { ChangeType } from 'src/app/modules/changes/changes.component';
|
||||
@@ -80,30 +80,27 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
||||
public appId: string = '';
|
||||
public app?: App.AsObject;
|
||||
|
||||
public environmentMap$ = this.envSvc.env.pipe(
|
||||
map((env) => {
|
||||
return {
|
||||
issuer: env.issuer,
|
||||
adminServiceUrl: `${env.api}/admin/v1`,
|
||||
mgmtServiceUrl: `${env.api}/management/v1`,
|
||||
authServiceUrl: `${env.api}/auth/v1`,
|
||||
samlCertificateURL: `${env.issuer}/saml/v2/certificate`,
|
||||
samlSSO: `${env.issuer}/saml/v2/SSO`,
|
||||
samlSLO: `${env.issuer}/saml/v2/SLO`,
|
||||
};
|
||||
}),
|
||||
public apiURLs$ = this.envSvc.env.pipe(
|
||||
mergeMap((env) =>
|
||||
this.wellknownURLs$.pipe(
|
||||
map((wellknown) => {
|
||||
return [
|
||||
['Issuer', env.issuer],
|
||||
['Admin Service URL', `${env.api}/admin/v1`],
|
||||
['Management Service URL', `${env.api}/management/v1`],
|
||||
['Auth Service URL', `${env.api}/auth/v1`],
|
||||
...wellknown.filter(
|
||||
([k, v]) => k === 'Revocation Endpoint' || k === 'JKWS URI' || k === 'Introspection Endpoint',
|
||||
),
|
||||
];
|
||||
}),
|
||||
),
|
||||
),
|
||||
);
|
||||
public apiMap$ = this.envSvc.env.pipe(
|
||||
map((env) => {
|
||||
return {
|
||||
issuer: env.issuer,
|
||||
adminServiceUrl: `${env.api}/admin/v1`,
|
||||
mgmtServiceUrl: `${env.api}/management/v1`,
|
||||
authServiceUrl: `${env.api}/auth/v1`,
|
||||
};
|
||||
}),
|
||||
);
|
||||
public samlMap$ = this.envSvc.env.pipe(
|
||||
|
||||
public issuer$ = this.apiURLs$.pipe(map((urls) => urls.find(([k, v]) => k === 'Issuer')?.[1]));
|
||||
|
||||
public samlURLs$ = this.envSvc.env.pipe(
|
||||
map((env) => {
|
||||
return {
|
||||
samlCertificateURL: `${env.issuer}/saml/v2/certificate`,
|
||||
@@ -112,7 +109,21 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
||||
};
|
||||
}),
|
||||
);
|
||||
public wellknownMap$ = this.envSvc.wellknown;
|
||||
|
||||
public wellknownURLs$ = this.envSvc.wellknown.pipe(
|
||||
map((wellknown) => {
|
||||
return [
|
||||
['Authorization Endpoint', wellknown.authorization_endpoint],
|
||||
['Device Authorization Endpoint', wellknown.device_authorization_endpoint],
|
||||
['End Session Endpoint', wellknown.end_session_endpoint],
|
||||
['Introspection Endpoint', wellknown.introspection_endpoint],
|
||||
['JKWS URI', wellknown.jwks_uri],
|
||||
['Revocation Endpoint', wellknown.revocation_endpoint],
|
||||
['Token Endpoint', wellknown.token_endpoint],
|
||||
['Userinfo Endpoint', wellknown.userinfo_endpoint],
|
||||
];
|
||||
}),
|
||||
);
|
||||
|
||||
public oidcResponseTypes: OIDCResponseType[] = [
|
||||
OIDCResponseType.OIDC_RESPONSE_TYPE_CODE,
|
||||
@@ -217,9 +228,6 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
||||
if (!this.app) {
|
||||
this.app = new App().toObject();
|
||||
}
|
||||
if (!this.app.samlConfig) {
|
||||
this.app.samlConfig = new SAMLConfig().toObject();
|
||||
}
|
||||
|
||||
let minimalMetadata =
|
||||
this.entityId?.value && this.acsURL?.value
|
||||
@@ -231,6 +239,14 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
||||
</md:EntityDescriptor>`
|
||||
: '';
|
||||
|
||||
if (!minimalMetadata && !this.metadataUrl?.value) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this.app.samlConfig) {
|
||||
this.app.samlConfig = new SAMLConfig().toObject();
|
||||
}
|
||||
|
||||
if (minimalMetadata) {
|
||||
const base64 = Buffer.from(minimalMetadata, 'utf-8').toString('base64');
|
||||
this.app.samlConfig.metadataXml = base64;
|
||||
|
||||
Reference in New Issue
Block a user