mirror of
https://github.com/zitadel/zitadel.git
synced 2025-01-07 22:37:40 +00:00
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:
parent
aa2d547eb2
commit
a141b8f3e7
@ -248,7 +248,7 @@ export class OrgDetailComponent implements OnInit, OnDestroy {
|
|||||||
this.metadata = resp.resultList.map((md) => {
|
this.metadata = resp.resultList.map((md) => {
|
||||||
return {
|
return {
|
||||||
key: md.key,
|
key: md.key,
|
||||||
value: Buffer.from(md.value as string, 'base64').toString('ascii'),
|
value: Buffer.from(md.value as string, 'base64').toString('utf-8'),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
@ -521,7 +521,7 @@ export class AppCreateComponent implements OnInit, OnDestroy {
|
|||||||
get decodedBase64(): string {
|
get decodedBase64(): string {
|
||||||
const samlReq = this.samlAppRequest.toObject();
|
const samlReq = this.samlAppRequest.toObject();
|
||||||
if (samlReq && samlReq.metadataXml && typeof samlReq.metadataXml === 'string') {
|
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 {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@ -529,7 +529,7 @@ export class AppCreateComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
set decodedBase64(xmlString) {
|
set decodedBase64(xmlString) {
|
||||||
if (this.samlAppRequest) {
|
if (this.samlAppRequest) {
|
||||||
const base64 = Buffer.from(xmlString, 'ascii').toString('base64');
|
const base64 = Buffer.from(xmlString, 'utf-8').toString('base64');
|
||||||
this.samlAppRequest.setMetadataXml(base64);
|
this.samlAppRequest.setMetadataXml(base64);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -786,7 +786,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
this.app.samlConfig.metadataXml &&
|
this.app.samlConfig.metadataXml &&
|
||||||
typeof this.app.samlConfig.metadataXml === 'string'
|
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 {
|
} else {
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
@ -794,7 +794,7 @@ export class AppDetailComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
set decodedBase64(xmlString: string) {
|
set decodedBase64(xmlString: string) {
|
||||||
if (this.app && this.app.samlConfig && this.app.samlConfig.metadataXml) {
|
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) {
|
if (this.app.samlConfig) {
|
||||||
this.app.samlConfig.metadataXml = base64;
|
this.app.samlConfig.metadataXml = base64;
|
||||||
|
@ -406,7 +406,7 @@ export class AuthUserDetailComponent implements OnDestroy {
|
|||||||
this.metadata = resp.resultList.map((md) => {
|
this.metadata = resp.resultList.map((md) => {
|
||||||
return {
|
return {
|
||||||
key: md.key,
|
key: md.key,
|
||||||
value: Buffer.from(md.value as string, 'base64').toString('ascii'),
|
value: Buffer.from(md.value as string, 'base64').toString('utf8'),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
@ -508,7 +508,7 @@ export class UserDetailComponent implements OnInit {
|
|||||||
this.metadata = resp.resultList.map((md) => {
|
this.metadata = resp.resultList.map((md) => {
|
||||||
return {
|
return {
|
||||||
key: md.key,
|
key: md.key,
|
||||||
value: Buffer.from(md.value as string, 'base64').toString('ascii'),
|
value: Buffer.from(md.value as string, 'base64').toString('utf-8'),
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user