Skip to content

OAuth2 Authentication policy conflicting oneOf #1007

Closed
@JBBianchi

Description

@JBBianchi

What seems off:
When using a secret based OAuth2 authentication policy, it conflicts with the OAuth2 authentication properties (oauth2AuthenticationProperties) because the later is not restrictive enough.

For instance:

#...
use:
  secrets:
    - mySecret
  authentications:
    synapseOAuth2:
      oidc:
        use: mySecret
#...

Will raise validation errors, because it matches both https://serverlessworkflow.io/schemas/1.0.0-alpha1/workflow.yaml#/$defs/authenticationPolicy/oneOf/4/oidc's oneOfs:

#...
    - title: OpenIdConnectAuthenticationPolicy
      description: Use OpenIdConnect authentication.
      properties:
        oidc:
          type: object
          title: OpenIdConnectAuthenticationPolicyConfiguration
          description: The configuration of the OpenIdConnect authentication policy.
          unevaluatedProperties: false
          oneOf:
            - $ref: '#/$defs/oauth2AuthenticationProperties'
              title: OpenIdConnectAuthenticationProperties
              description: The inline configuration of the OpenIdConnect authentication policy.
            - $ref: '#/$defs/secretBasedAuthenticationPolicy'
              title: OpenIdConnectAuthenticationPolicySecret
              description: Secret based configuration of the OpenIdConnect authentication policy.
      required: [ oidc ]
  oauth2AuthenticationProperties:
    type: object
    title: OAuth2AutenthicationData
    description: Inline configuration of the OAuth2 authentication policy.
    properties:
      authority:
        type: string
        format: uri-template
        title: OAuth2AutenthicationDataAuthority
        description: The URI that references the OAuth2 authority to use.
#...

What you expected to be:
For each oneOf to be clearly distinct.

  • Specification version used: 1.0.0-alpha3

Metadata

Metadata

Assignees

Labels

area: specChanges in the Specificationchange: fixSomething isn't working. Impacts in a minor version change.

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions