MCPcopy
hub / github.com/authts/oidc-client-ts / getMetadata

Method getMetadata

src/MetadataService.ts:50–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48 }
49
50 public async getMetadata(): Promise<Partial<OidcMetadata>> {
51 const logger = this._logger.create("getMetadata");
52 if (this._metadata) {
53 logger.debug("using cached values");
54 return this._metadata;
55 }
56
57 if (!this._metadataUrl) {
58 logger.throw(new Error("No authority or metadataUrl configured on settings"));
59 // eslint-disable-next-line @typescript-eslint/only-throw-error
60 throw null; // https://github.com/microsoft/TypeScript/issues/46972
61 }
62
63 logger.debug("getting metadata from", this._metadataUrl);
64 const metadata = await this._jsonService.getJson(this._metadataUrl, { credentials: this._fetchRequestCredentials, timeoutInSeconds: this._settings.requestTimeoutInSeconds });
65
66 logger.debug("merging remote JSON with seed metadata");
67 this._metadata = Object.assign({}, metadata, this._settings.metadataSeed);
68 return this._metadata;
69 }
70
71 public getIssuer(): Promise<string> {
72 return this._getMetadataProperty("issuer") as Promise<string>;

Callers 2

_getMetadataPropertyMethod · 0.95

Calls 4

throwMethod · 0.80
getJsonMethod · 0.80
debugMethod · 0.65
createMethod · 0.45

Tested by

no test coverage detected