@scalar/mock-server
Advanced tools
Comparing version 0.2.72 to 0.2.73
# @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 @@ } |
@@ -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 |
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
65674
850
+ Added@scalar/oas-utils@0.2.69(transitive)
+ Added@unhead/schema@1.11.11(transitive)
+ Addedhono@4.6.11(transitive)
+ Addednanoid@5.0.8(transitive)
- Removed@scalar/oas-utils@0.2.68(transitive)
- Removed@unhead/schema@1.11.13(transitive)
- Removedhono@4.6.12(transitive)
- Removednanoid@5.0.9(transitive)
Updated@scalar/oas-utils@0.2.69