Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@scalar/mock-server

Package Overview
Dependencies
Maintainers
0
Versions
155
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@scalar/mock-server - npm Package Compare versions

Comparing version 0.2.72 to 0.2.73

9

CHANGELOG.md
# @scalar/mock-server
## 0.2.73
### Patch Changes
- b28c70f: feat: add openIdConnect support
- Updated dependencies [8c5d767]
- Updated dependencies [359ee2d]
- @scalar/oas-utils@0.2.69
## 0.2.72

@@ -4,0 +13,0 @@

@@ -62,2 +62,9 @@ import { getCookie } from 'hono/cookie';

break;
case 'openIdConnect':
authScheme = 'Bearer';
// Handle OpenID Connect similar to OAuth2
if (c.req.header('Authorization')?.startsWith('Bearer ')) {
isAuthenticated = true;
}
break;
}

@@ -64,0 +71,0 @@ }

6

dist/utils/logAuthenticationInstructions.js

@@ -104,3 +104,7 @@ import { getPathFromUrl } from './getOpenAuthTokenUrls.js';

case 'openIdConnect':
console.log('⚠️ OpenID Connect Authentication');
console.log('✅ OpenID Connect Authentication');
console.log(' Use the following OpenID Connect discovery URL:');
console.log();
console.log(` ${getPathFromUrl(scheme.openIdConnectUrl || '/.well-known/openid-configuration')}`);
console.log();
break;

@@ -107,0 +111,0 @@ default:

@@ -53,2 +53,24 @@ import { respondWithAuthorizePage } from '../routes/respondWithAuthorizePage.js';

}
else if (scheme.type === 'openIdConnect') {
// Handle OpenID Connect configuration
if (scheme.openIdConnectUrl) {
const configPath = getPathFromUrl(scheme.openIdConnectUrl ?? '/.well-known/openid-configuration');
// Add route for OpenID Connect configuration
app.get(configPath, (c) => {
return c.json({
issuer: 'https://example.com',
authorization_endpoint: '/oauth/authorize',
token_endpoint: '/oauth/token',
response_types_supported: ['code', 'token', 'id_token'],
subject_types_supported: ['public'],
id_token_signing_alg_values_supported: ['RS256'],
});
});
// Add standard endpoints
const authorizeRoute = '/oauth/authorize';
const tokenRoute = '/oauth/token';
authorizeUrls.add(getPathFromUrl(authorizeRoute));
tokenUrls.add(tokenRoute);
}
}
});

@@ -55,0 +77,0 @@ // Set up unique authorization routes

6

package.json

@@ -19,3 +19,3 @@ {

],
"version": "0.2.72",
"version": "0.2.73",
"engines": {

@@ -43,4 +43,4 @@ "node": ">=18"

"@scalar/openapi-parser": "0.8.8",
"@scalar/oas-utils": "0.2.68",
"@scalar/openapi-types": "0.1.4"
"@scalar/openapi-types": "0.1.4",
"@scalar/oas-utils": "0.2.69"
},

@@ -47,0 +47,0 @@ "devDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc