Skip to content

Commit aefd352

Browse files
committed
updated for auth
1 parent 73f02aa commit aefd352

16 files changed

+587
-94
lines changed

Cakefile

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ sourceFiles = [
1616
'view/ContentTypeView'
1717
'view/ResponseContentTypeView'
1818
'view/ParameterContentTypeView'
19+
'view/ApiKeyButton'
20+
'view/BasicAuthButton'
1921
]
2022

2123

dist/lib/shred.bundle.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -2131,10 +2131,10 @@ require.define("/shred/mixins/headers.js", function (require, module, exports, _
21312131
// to `Content-Type`.
21322132

21332133
var corsetCase = function(string) {
2134-
return string.toLowerCase()
2134+
return string;//.toLowerCase()
21352135
//.replace("_","-")
2136-
.replace(/(^|-)(\w)/g,
2137-
function(s) { return s.toUpperCase(); });
2136+
// .replace(/(^|-)(\w)/g,
2137+
// function(s) { return s.toUpperCase(); });
21382138
};
21392139

21402140
// We suspect that `initializeHeaders` was once more complicated ...

dist/lib/swagger-client.js

+15-9
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,20 @@ SwaggerAuthorizations.prototype.apply = function(obj, authorizations) {
8787
}
8888
}
8989
else {
90-
for(name in authorizations) {
91-
for (key in this.authz) {
92-
if(key == name) {
93-
value = this.authz[key];
94-
result = value.apply(obj, authorizations);
95-
if (result === true)
96-
status = true;
90+
if(Array.isArray(authorizations)) {
91+
var i;
92+
for(i = 0; i < authorizations.length; i++) {
93+
var auth = authorizations[i];
94+
log(auth);
95+
for (key in this.authz) {
96+
var value = this.authz[key];
97+
if(typeof value !== 'undefined') {
98+
result = value.apply(obj, authorizations);
99+
if (result === true)
100+
status = true;
101+
}
97102
}
98-
}
103+
}
99104
}
100105
}
101106

@@ -382,7 +387,7 @@ SwaggerClient.prototype.buildFromSpec = function(response) {
382387
this.apisArray = [];
383388
this.consumes = response.consumes;
384389
this.produces = response.produces;
385-
this.authSchemes = response.authorizations;
390+
this.securityDefinitions = response.securityDefinitions;
386391

387392
var location = this.parseUri(this.url);
388393
if(typeof this.schemes === 'undefined' || this.schemes.length === 0) {
@@ -540,6 +545,7 @@ var Operation = function(parent, operationId, httpMethod, path, args, definition
540545
this.responses = (args.responses||{});
541546
this.type = null;
542547
this.security = args.security;
548+
this.authorizations = args.security;
543549
this.description = args.description;
544550

545551
var i;

0 commit comments

Comments
 (0)