fix(openapi): add securitySchemes and global security requirement to OpenAPI spec#34998
fix(openapi): add securitySchemes and global security requirement to OpenAPI spec#34998
Conversation
…OpenAPI spec Fixes #34996 The OpenAPI spec at /api/openapi.json declared security: [] globally with no securitySchemes defined, making all 689 endpoints appear unauthenticated to scanners and API consumers even though the server enforces auth on the vast majority of them. Changes: - DotRestApplication: add @SecuritySchemes (ApiToken/Bearer JWT, BasicAuth, DotAuth header) and set global security default in @OpenAPIDefinition - HealthResource: mark all 8 health/liveness/readiness endpoints as public (security = {}) — required for k8s probes and monitoring - AuthenticationResource: mark login and logInUser as public - ForgotPasswordResource: mark forgot password as public - DotSamlResource: mark all 5 SAML SSO flow endpoints as public (login, callback, metadata, logout POST/GET) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Claude finished @sfreudenthaler's task in 1m 33s —— View job PR Review
Three issues worth fixing before merge: 1.
|
Summary
Fixes #34996
The OpenAPI spec at
/api/openapi.jsondeclaredsecurity: []globally with nosecuritySchemesdefined, documenting all 689 endpoints as unauthenticated even though the server enforces auth on the vast majority of them.@SecuritySchemestoDotRestApplication— three schemes matching the actual auth waterfall inWebResource.java: ApiToken (JWT Bearer), BasicAuth (HTTP Basic), DotAuth (DOTAUTH header)securitydefault in@OpenAPIDefinition— all endpoints now require auth in the spec unless explicitly overriddensecurity = {}override: health/liveness/readiness checks (required for k8s probes), login, forgot password, and all SAML SSO flow endpointsFiles Changed
DotRestApplication.java@SecuritySchemes+ globalsecurityto@OpenAPIDefinitionHealthResource.javasecurity = {}on all 8 health endpointsAuthenticationResource.javasecurity = {}on login + logInUserForgotPasswordResource.javasecurity = {}on forgot passwordDotSamlResource.javasecurity = {}on all 5 SAML SSO endpointsTest Plan
curl https://<instance>/api/openapi.json | jq '.components.securitySchemes'— should return ApiToken, BasicAuth, DotAuth schemescurl https://<instance>/api/openapi.json | jq '.security'— should return[{"ApiToken":[]},{"BasicAuth":[]}]"security": []in the generated spec"security": []/api/openapi.jsonis served without errors🤖 Generated with Claude Code