Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to update API with authentication info #5730

Open
jeffesp opened this issue Nov 18, 2024 · 2 comments
Open

Unable to update API with authentication info #5730

jeffesp opened this issue Nov 18, 2024 · 2 comments

Comments

@jeffesp
Copy link

jeffesp commented Nov 18, 2024

Branch/Environment/Version

Tyk version 5.5 using the Gateway API

Relevant Document

https://tyk.io/docs/getting-started/using-oas-definitions/update-an-oas-api/#step-2-update-the-tyk-oas-api

Describe the error

When I try to update the API following the instructions in "Tutorial 2" I get the following error when making the PUT request to the API (PUT to /tyk/apis/oas/<api-id>).

{
  "status": "error",
  "message": "(root): Additional property basic-config-and-security/security is not allowed"
}

It seems like the "diff" that includes the basic-config-and-security/security change is wrong?

I also tried just adding a security element as defined in the OAS docs, but that gave me this error, with nothing else in the gateway logs:

{
  "status": "error",
  "message": "request malformed"
}

A request without either of the above but having security defined in the components/securitySchemes and the x-tyk-api-gateway/server/authentication sections does seem to work, but I am not sure that it should.

Example of securitySchemes:

  "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }

Example of x-tky-api-gateway auth definition:

  "server": {
      "listenPath": {
        "value": "/a-service/",
        "strip": true
      },
      "authentication": {
        "enabled": true,
        "securitySchemes": {
          "bearerAuth": {
            "enabled": true
          }
        }
      }
    }

Should what I have done work? Can the docs be updated if so?

Screenshots/Video

Additional context

@jeffesp
Copy link
Author

jeffesp commented Nov 18, 2024

This page seems to give more context to the whole situation, but seems to indicate that the security element in the OAS should work, which I do not see.

@jeffesp
Copy link
Author

jeffesp commented Nov 18, 2024

Just figured out my issue - it was a problem with my security section. So I would summarize the issue here as you should not be indicating basic-config-and-security - it's just security.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant