fix(console): set metadata value encoding to utf-8 (#6392)

* fix: set encoding to utf-8

* org metadata encoding

* user detail mgmt encoding

* utf-8 encoding decoding of saml applications

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
This commit is contained in:
Max Peintner 2023-08-19 09:16:40 +02:00 committed by GitHub
parent aa2d547eb2
commit a141b8f3e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View File

@ -248,7 +248,7 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
this.metadata = resp.resultList.map((md) => {
return {
key: md.key,
value: Buffer.from(md.value as string, 'base64').toString('ascii'),
value: Buffer.from(md.value as string, 'base64').toString('utf-8'),
};
});
})

View File

@ -521,7 +521,7 @@ export class AppCreateComponent implements OnInit, OnDestroy {
get decodedBase64(): string {
const samlReq = this.samlAppRequest.toObject();
if (samlReq && samlReq.metadataXml && typeof samlReq.metadataXml === 'string') {
return Buffer.from(samlReq.metadataXml, 'base64').toString('ascii');
return Buffer.from(samlReq.metadataXml, 'base64').toString('utf-8');
} else {
return '';
}
@ -529,7 +529,7 @@ export class AppCreateComponent implements OnInit, OnDestroy {
set decodedBase64(xmlString) {
if (this.samlAppRequest) {
const base64 = Buffer.from(xmlString, 'ascii').toString('base64');
const base64 = Buffer.from(xmlString, 'utf-8').toString('base64');
this.samlAppRequest.setMetadataXml(base64);
}
}

View File

@ -786,7 +786,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
this.app.samlConfig.metadataXml &&
typeof this.app.samlConfig.metadataXml === 'string'
) {
return Buffer.from(this.app?.samlConfig.metadataXml, 'base64').toString('ascii');
return Buffer.from(this.app?.samlConfig.metadataXml, 'base64').toString('utf-8');
} else {
return '';
}
@ -794,7 +794,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
set decodedBase64(xmlString: string) {
if (this.app && this.app.samlConfig && this.app.samlConfig.metadataXml) {
const base64 = Buffer.from(xmlString, 'ascii').toString('base64');
const base64 = Buffer.from(xmlString, 'utf-8').toString('base64');
if (this.app.samlConfig) {
this.app.samlConfig.metadataXml = base64;

View File

@ -406,7 +406,7 @@ export class AuthUserDetailComponent implements OnDestroy {
this.metadata = resp.resultList.map((md) => {
return {
key: md.key,
value: Buffer.from(md.value as string, 'base64').toString('ascii'),
value: Buffer.from(md.value as string, 'base64').toString('utf8'),
};
});
})

View File

@ -508,7 +508,7 @@ export class UserDetailComponent implements OnInit {
this.metadata = resp.resultList.map((md) => {
return {
key: md.key,
value: Buffer.from(md.value as string, 'base64').toString('ascii'),
value: Buffer.from(md.value as string, 'base64').toString('utf-8'),
};
});
})