File tree Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -8,10 +8,10 @@ import { OAuthServerProvider } from './provider.js';
88import { OAuthMetadata , OAuthProtectedResourceMetadata } from '../../shared/auth.js' ;
99
1010// Check for dev mode flag that allows HTTP issuer URLs (for development/testing only)
11- const allowHttpForDev = process . env . MCP_ALLOW_HTTP_AUTH_FOR_DEV_UNSAFE === 'true' || process . env . MCP_ALLOW_HTTP_AUTH_FOR_DEV_UNSAFE === '1' ;
12- if ( allowHttpForDev ) {
11+ const allowInsecureIssuerUrl = process . env . MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL === 'true' || process . env . MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL === '1' ;
12+ if ( allowInsecureIssuerUrl ) {
1313 // eslint-disable-next-line no-console
14- console . warn ( 'MCP_ALLOW_HTTP_AUTH_FOR_DEV_UNSAFE is enabled - HTTP issuer URLs are allowed. Do not use in production.' ) ;
14+ console . warn ( 'MCP_DANGEROUSLY_ALLOW_INSECURE_ISSUER_URL is enabled - HTTP issuer URLs are allowed. Do not use in production.' ) ;
1515}
1616
1717export type AuthRouterOptions = {
@@ -62,7 +62,7 @@ export type AuthRouterOptions = {
6262
6363const checkIssuerUrl = ( issuer : URL ) : void => {
6464 // Technically RFC 8414 does not permit a localhost HTTPS exemption, but this will be necessary for ease of testing
65- if ( issuer . protocol !== 'https:' && issuer . hostname !== 'localhost' && issuer . hostname !== '127.0.0.1' && ! allowHttpForDev ) {
65+ if ( issuer . protocol !== 'https:' && issuer . hostname !== 'localhost' && issuer . hostname !== '127.0.0.1' && ! allowInsecureIssuerUrl ) {
6666 throw new Error ( 'Issuer URL must be HTTPS' ) ;
6767 }
6868 if ( issuer . hash ) {
You can’t perform that action at this time.
0 commit comments