Files
matrix-quotes-bot/node_modules/matrix-js-sdk/lib/oauth/discover.d.ts

58 lines
3.0 KiB
TypeScript
Raw Normal View History

2026-09-12 23:57:45 -04:00
/**
* Metadata from OAuth 2.0 client authentication API as per
* https://spec.matrix.org/v1.18/client-server-api/#get_matrixclientv1auth_metadata
* With validated properties required in type
*/
export interface ValidatedAuthMetadata {
/** List of actions that the account management URL supports. */
account_management_actions_supported?: string[];
/** The URL where the user is able to access the account management capabilities of the homeserver. */
account_management_uri?: string;
/** URL of the authorization endpoint, necessary to use the authorization code grant. */
authorization_endpoint: string;
/**
* List of OAuth 2.0 Proof Key for Code Exchange (PKCE) code challenge methods that the server supports at the authorization endpoint.
*
* This array MUST contain at least the S256 value, for improved security in the authorization code grant.
*/
code_challenge_methods_supported: string[];
/** URL of the device authorization endpoint, as defined in RFC 8628, necessary to use the device authorization grant. */
device_authorization_endpoint?: string;
/**
* List of OAuth 2.0 grant type strings that the server supports at the token endpoint.
*
* This array MUST contain at least the authorization_code and refresh_token values,
* for clients to be able to use the authorization code grant and refresh token grant, respectively.
*/
grant_types_supported: string[];
/** The authorization server’s issuer identifier, which is a URL that uses the https scheme and has no query or fragment components. */
issuer: string;
/** List of OpenID Connect prompt values that the server supports at the authorization endpoint. */
prompt_values_supported?: string[];
/** URL of the client registration endpoint, necessary to perform dynamic registration of a client. */
registration_endpoint: string;
/**
* List of OAuth 2.0 response mode strings that the server supports at the authorization endpoint.
*
* This array MUST contain at least the query and fragment values, for improved security in the authorization code grant.
*/
response_modes_supported: string[];
/**
* List of OAuth 2.0 response type strings that the server supports at the authorization endpoint.
*
* This array MUST contain at least the code value, for clients to be able to use the authorization code grant.
*/
response_types_supported: string[];
/** URL of the revocation endpoint, necessary to log out a client by invalidating its access and refresh tokens. */
revocation_endpoint: string;
/** URL of the token endpoint, used by the grants. */
token_endpoint: string;
}
/**
* Validates OAuth 2.0 auth metadata as defined by
* https://spec.matrix.org/v1.18/client-server-api/#get_matrixclientv1auth_metadata
* @param authMetadata - json object
* @returns boolean of whether the input is valid
*/
export declare const isValidAuthMetadata: (authMetadata: unknown) => authMetadata is ValidatedAuthMetadata;
//# sourceMappingURL=discover.d.ts.map