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

(bump) renaming api_key #1766

Closed
Luthien-in-edhil opened this issue Nov 19, 2015 · 4 comments
Closed

(bump) renaming api_key #1766

Luthien-in-edhil opened this issue Nov 19, 2015 · 4 comments

Comments

@Luthien-in-edhil
Copy link

in this issue #36 it was asked if it is possible to rename the api_key to something different. The issue was resolved by implementing this possibility, with an explanation how to use it here: https://github.com/wordnik/swagger-ui#api-key-parameter.
However, I cannot find anything about it there, nor anywhere else - that page anchor neither exists any longer.
There is much talking about how to move the api_key to the header, but nothing at all about how to change its name. Was that feature maybe dropped again?

My problem is that our services accept an authorisation parameter named wskey.

I don't know exactly how this works (I'm not that familiar with front-end coding, alas) but I'm guessing that the swagger .js code pre-populates any field labeled api_key with whatever has been filled in the header text area labeled api_key.
I certainly would like to get that working, but I can't think of any way to achieve that apart from renaming the appropriate variables in the index.html and the javascript files, but that'd be a bit of a dirty hack.

Is there an easier way to achieve this? Or am I overlooking something obvious?

thanks in advance,
Lúthien

@webron
Copy link
Contributor

webron commented Nov 19, 2015

Just open the index.html file and replace api_key with wskey at all places.

@ponelat
Copy link
Member

ponelat commented Nov 20, 2015

@Luthien-in-edhil , currently there isn't a way to rename api_key without changing code... even if it is slight, as @webron suggests.

However there is a plan to include dynamic security... such that the UI would look at the swagger.json file and generate a simple form for the security layers found therein.
@webron am I correct in guessing, this is most likely the next major feature in swagger-ui?

@webron
Copy link
Contributor

webron commented Nov 20, 2015

There's a plan, I can't say it's the next major feature though. There's a ticket about it.

ikitommi added a commit to metosin/ring-swagger-ui that referenced this issue Nov 28, 2015
Swagger-ui uses hard-coded `api_key` query-param for api-keys,
with this commit, one can override this in the swagger spec -
both key-name & in (header, query etc.) There are lot's of open
issues related to this, without any resolution time-table. See:

swagger-api/swagger-ui#1766
swagger-api/swagger-ui#1731
swagger-api/swagger-ui#1593
@webron
Copy link
Contributor

webron commented Jun 9, 2016

This should no longer be an issue.

@webron webron closed this as completed Jun 9, 2016
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

3 participants