-
Notifications
You must be signed in to change notification settings - Fork 9k
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
send function to swagger.js #176
Comments
please support the same for additional header params :) |
+1 Would be very nice to be able to have arbitrary headers defined as inputs in the banner. |
getting there. We're just finishing up oauth 2 in the swagger spec for java, moving to node next. |
Sweet :-) -Paul Hill On 2013-06-23, at 8:17 PM, Tony Tam [email protected] wrote:
|
also, if you missed it... |
Dude, that's awesome. Your timing is perfect. I'm going to jump right on that. -Paul Hill On 2013-06-23, at 8:45 PM, Tony Tam [email protected] wrote:
|
OK, let me know if you need help on it |
While I've got your ear. -Paul Hill On 2013-06-23, at 8:45 PM, Tony Tam [email protected] wrote:
|
Sorry I meant 2 swagger-node-express instances. On Sunday, June 23, 2013, Paul Hill wrote:
|
eh, I haven't thought through that yet, so glad you brought it up before a refactor starts. Let's open a new ticket so it can be addressed |
I don't mind doing it. Just wanted to check it didn't mess you up. On Sunday, June 23, 2013, Tony Tam wrote:
|
sure, please feel free |
Ok, I've written it as an object constructor export. Will test it tomorrow and submit a pull request. -Paul Hill On 2013-06-23, at 9:48 PM, Tony Tam [email protected] wrote:
|
I ended up writing a little requires cache name-spacing gizmo that made it I did write the code for the object thing so I'll just email it to you if My little cache name spacing gizmo works better in my case because I know I :-) On Sunday, June 23, 2013, Paul Hill wrote:
|
Sorry to co-opt this thread. Still looking forward to arbitrary headers for auth in swagger-ui |
You can now add any header params you like, programmatically. See in swagger-js, which is integrated in this branch of swagger-ui: https://github.com/wordnik/swagger-ui/tree/develop-2.0 |
That functionality has been there for a while. But I believe the intention was to make it so the user could enter an oauth token in an input field to be sent as a header on each subsequent request. -Paul Hill On 2013-07-11, at 10:26 PM, Tony Tam [email protected] wrote:
|
hey @fehguy and @paulhill . Do you mind pointing where to look for custom headers by method? Is not develop-2.0 behind master? I want to modify swagger-ui to sign all requests using something like amazon does http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html. Theoretically It should intercept the ajax request, use some of the parameters for create the hasg, add a custom http header with the hash and then allow the ajax call to continue. Thanks, swagger is great. |
hi @diaspar swagger-ui is now up-to-date, develop-2.0 is obsolete (and going away soon). I think we chatted on irc (or somebody else today asked the exact same question) but you should look here: https://github.com/wordnik/swagger-ui#custom-header-parameters---for-basic-auth-etc and of course you can write your own signing routine by making something like this: https://github.com/wordnik/swagger-js/blob/master/src/swagger.coffee#L792 class ApiKeyAuthorization
type: null
name: null
value: null
constructor: (name, value, type) ->
@name = name
@value = value
@type = type
apply: (obj) ->
if @type == "query"
if obj.url.indexOf('?') > 0
obj.url = obj.url + "&" + @name + "=" + @value
else
obj.url = obj.url + "?" + @name + "=" + @value
true
else if @type == "header"
obj.headers[@name] = @value |
Right now, need to reload swagger.js when key changes. Would be best if we can pass a function to swagger.js so it's read on each query.
The text was updated successfully, but these errors were encountered: