fix: validate clientMetadataUrl at construction time (fail-fast) (#1653)
Co-authored-by: Luis <reche@Luiss-MacBook-Pro.local> Co-authored-by: Felix Weinberger <3823880+felixweinberger@users.noreply.github.com>
This commit is contained in:
parent
595652ceca
commit
6bec24a14c
1 changed files with 113 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import type { OAuthClientInformationMixed, OAuthClientMetadata, OAuthClientProvider, OAuthTokens } from '@modelcontextprotocol/client';
|
||||
import { validateClientMetadataUrl } from '@modelcontextprotocol/client';
|
||||
|
||||
/**
|
||||
* In-memory OAuth client provider for demonstration purposes
|
||||
|
|
@ -15,6 +16,9 @@ export class InMemoryOAuthClientProvider implements OAuthClientProvider {
|
|||
onRedirect?: (url: URL) => void,
|
||||
public readonly clientMetadataUrl?: string
|
||||
) {
|
||||
// Validate clientMetadataUrl at construction time (fail-fast)
|
||||
validateClientMetadataUrl(clientMetadataUrl);
|
||||
|
||||
this._onRedirect =
|
||||
onRedirect ||
|
||||
(url => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue