mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 10:53:34 +00:00
vendor files
This commit is contained in:
15
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/backbone-min.js
generated
vendored
Normal file
15
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/backbone-min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2278
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/handlebars-1.0.0.js
generated
vendored
Normal file
2278
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/handlebars-1.0.0.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
28
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/handlebars-2.0.0.js
generated
vendored
Normal file
28
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/handlebars-2.0.0.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/highlight.7.3.pack.js
generated
vendored
Normal file
1
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/highlight.7.3.pack.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
2
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/jquery-1.8.0.min.js
generated
vendored
Normal file
2
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/jquery-1.8.0.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
18
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/jquery.ba-bbq.min.js
generated
vendored
Normal file
18
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/jquery.ba-bbq.min.js
generated
vendored
Normal file
@ -0,0 +1,18 @@
|
||||
/*
|
||||
* jQuery BBQ: Back Button & Query Library - v1.2.1 - 2/17/2010
|
||||
* http://benalman.com/projects/jquery-bbq-plugin/
|
||||
*
|
||||
* Copyright (c) 2010 "Cowboy" Ben Alman
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* http://benalman.com/about/license/
|
||||
*/
|
||||
(function($,p){var i,m=Array.prototype.slice,r=decodeURIComponent,a=$.param,c,l,v,b=$.bbq=$.bbq||{},q,u,j,e=$.event.special,d="hashchange",A="querystring",D="fragment",y="elemUrlAttr",g="location",k="href",t="src",x=/^.*\?|#.*$/g,w=/^.*\#/,h,C={};function E(F){return typeof F==="string"}function B(G){var F=m.call(arguments,1);return function(){return G.apply(this,F.concat(m.call(arguments)))}}function n(F){return F.replace(/^[^#]*#?(.*)$/,"$1")}function o(F){return F.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function f(H,M,F,I,G){var O,L,K,N,J;if(I!==i){K=F.match(H?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/);J=K[3]||"";if(G===2&&E(I)){L=I.replace(H?w:x,"")}else{N=l(K[2]);I=E(I)?l[H?D:A](I):I;L=G===2?I:G===1?$.extend({},I,N):$.extend({},N,I);L=a(L);if(H){L=L.replace(h,r)}}O=K[1]+(H?"#":L||!K[1]?"?":"")+L+J}else{O=M(F!==i?F:p[g][k])}return O}a[A]=B(f,0,o);a[D]=c=B(f,1,n);c.noEscape=function(G){G=G||"";var F=$.map(G.split(""),encodeURIComponent);h=new RegExp(F.join("|"),"g")};c.noEscape(",/");$.deparam=l=function(I,F){var H={},G={"true":!0,"false":!1,"null":null};$.each(I.replace(/\+/g," ").split("&"),function(L,Q){var K=Q.split("="),P=r(K[0]),J,O=H,M=0,R=P.split("]["),N=R.length-1;if(/\[/.test(R[0])&&/\]$/.test(R[N])){R[N]=R[N].replace(/\]$/,"");R=R.shift().split("[").concat(R);N=R.length-1}else{N=0}if(K.length===2){J=r(K[1]);if(F){J=J&&!isNaN(J)?+J:J==="undefined"?i:G[J]!==i?G[J]:J}if(N){for(;M<=N;M++){P=R[M]===""?O.length:R[M];O=O[P]=M<N?O[P]||(R[M+1]&&isNaN(R[M+1])?{}:[]):J}}else{if($.isArray(H[P])){H[P].push(J)}else{if(H[P]!==i){H[P]=[H[P],J]}else{H[P]=J}}}}else{if(P){H[P]=F?i:""}}});return H};function z(H,F,G){if(F===i||typeof F==="boolean"){G=F;F=a[H?D:A]()}else{F=E(F)?F.replace(H?w:x,""):F}return l(F,G)}l[A]=B(z,0);l[D]=v=B(z,1);$[y]||($[y]=function(F){return $.extend(C,F)})({a:k,base:k,iframe:t,img:t,input:t,form:"action",link:k,script:t});j=$[y];function s(I,G,H,F){if(!E(H)&&typeof H!=="object"){F=H;H=G;G=i}return this.each(function(){var L=$(this),J=G||j()[(this.nodeName||"").toLowerCase()]||"",K=J&&L.attr(J)||"";L.attr(J,a[I](K,H,F))})}$.fn[A]=B(s,A);$.fn[D]=B(s,D);b.pushState=q=function(I,F){if(E(I)&&/^#/.test(I)&&F===i){F=2}var H=I!==i,G=c(p[g][k],H?I:{},H?F:2);p[g][k]=G+(/#/.test(G)?"":"#")};b.getState=u=function(F,G){return F===i||typeof F==="boolean"?v(F):v(G)[F]};b.removeState=function(F){var G={};if(F!==i){G=u();$.each($.isArray(F)?F:arguments,function(I,H){delete G[H]})}q(G,2)};e[d]=$.extend(e[d],{add:function(F){var H;function G(J){var I=J[D]=c();J.getState=function(K,L){return K===i||typeof K==="boolean"?l(I,K):l(I,L)[K]};H.apply(this,arguments)}if($.isFunction(F)){H=F;return G}else{H=F.handler;F.handler=G}}})})(jQuery,this);
|
||||
/*
|
||||
* jQuery hashchange event - v1.2 - 2/11/2010
|
||||
* http://benalman.com/projects/jquery-hashchange-plugin/
|
||||
*
|
||||
* Copyright (c) 2010 "Cowboy" Ben Alman
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* http://benalman.com/about/license/
|
||||
*/
|
||||
(function($,i,b){var j,k=$.event.special,c="location",d="hashchange",l="href",f=$.browser,g=document.documentMode,h=f.msie&&(g===b||g<8),e="on"+d in i&&!h;function a(m){m=m||i[c][l];return m.replace(/^[^#]*#?(.*)$/,"$1")}$[d+"Delay"]=100;k[d]=$.extend(k[d],{setup:function(){if(e){return false}$(j.start)},teardown:function(){if(e){return false}$(j.stop)}});j=(function(){var m={},r,n,o,q;function p(){o=q=function(s){return s};if(h){n=$('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow;q=function(){return a(n.document[c][l])};o=function(u,s){if(u!==s){var t=n.document;t.open().close();t[c].hash="#"+u}};o(a())}}m.start=function(){if(r){return}var t=a();o||p();(function s(){var v=a(),u=q(t);if(v!==t){o(t=v,u);$(i).trigger(d)}else{if(u!==t){i[c][l]=i[c][l].replace(/#.*/,"")+"#"+u}}r=setTimeout(s,$[d+"Delay"])})()};m.stop=function(){if(!n){r&&clearTimeout(r);r=0}};return m})()})(jQuery,this);
|
1
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/jquery.slideto.min.js
generated
vendored
Normal file
1
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/jquery.slideto.min.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
(function(b){b.fn.slideto=function(a){a=b.extend({slide_duration:"slow",highlight_duration:3E3,highlight:true,highlight_color:"#FFFF99"},a);return this.each(function(){obj=b(this);b("body").animate({scrollTop:obj.offset().top},a.slide_duration,function(){a.highlight&&b.ui.version&&obj.effect("highlight",{color:a.highlight_color},a.highlight_duration)})})}})(jQuery);
|
8
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/jquery.wiggle.min.js
generated
vendored
Normal file
8
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/jquery.wiggle.min.js
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
/*
|
||||
jQuery Wiggle
|
||||
Author: WonderGroup, Jordan Thomas
|
||||
URL: http://labs.wondergroup.com/demos/mini-ui/index.html
|
||||
License: MIT (http://en.wikipedia.org/wiki/MIT_License)
|
||||
*/
|
||||
jQuery.fn.wiggle=function(o){var d={speed:50,wiggles:3,travel:5,callback:null};var o=jQuery.extend(d,o);return this.each(function(){var cache=this;var wrap=jQuery(this).wrap('<div class="wiggle-wrap"></div>').css("position","relative");var calls=0;for(i=1;i<=o.wiggles;i++){jQuery(this).animate({left:"-="+o.travel},o.speed).animate({left:"+="+o.travel*2},o.speed*2).animate({left:"-="+o.travel},o.speed,function(){calls++;if(jQuery(cache).parent().hasClass('wiggle-wrap')){jQuery(cache).parent().replaceWith(cache);}
|
||||
if(calls==o.wiggles&&jQuery.isFunction(o.callback)){o.callback();}});}});};
|
1272
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/marked.js
generated
vendored
Normal file
1272
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/marked.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2765
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/shred.bundle.js
generated
vendored
Normal file
2765
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/shred.bundle.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
193
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/shred/content.js
generated
vendored
Normal file
193
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/shred/content.js
generated
vendored
Normal file
@ -0,0 +1,193 @@
|
||||
|
||||
// The purpose of the `Content` object is to abstract away the data conversions
|
||||
// to and from raw content entities as strings. For example, you want to be able
|
||||
// to pass in a Javascript object and have it be automatically converted into a
|
||||
// JSON string if the `content-type` is set to a JSON-based media type.
|
||||
// Conversely, you want to be able to transparently get back a Javascript object
|
||||
// in the response if the `content-type` is a JSON-based media-type.
|
||||
|
||||
// One limitation of the current implementation is that it [assumes the `charset` is UTF-8](https://github.com/spire-io/shred/issues/5).
|
||||
|
||||
// The `Content` constructor takes an options object, which *must* have either a
|
||||
// `body` or `data` property and *may* have a `type` property indicating the
|
||||
// media type. If there is no `type` attribute, a default will be inferred.
|
||||
var Content = function(options) {
|
||||
this.body = options.body;
|
||||
this.data = options.data;
|
||||
this.type = options.type;
|
||||
};
|
||||
|
||||
Content.prototype = {
|
||||
// Treat `toString()` as asking for the `content.body`. That is, the raw content entity.
|
||||
//
|
||||
// toString: function() { return this.body; }
|
||||
//
|
||||
// Commented out, but I've forgotten why. :/
|
||||
};
|
||||
|
||||
|
||||
// `Content` objects have the following attributes:
|
||||
Object.defineProperties(Content.prototype,{
|
||||
|
||||
// - **type**. Typically accessed as `content.type`, reflects the `content-type`
|
||||
// header associated with the request or response. If not passed as an options
|
||||
// to the constructor or set explicitly, it will infer the type the `data`
|
||||
// attribute, if possible, and, failing that, will default to `text/plain`.
|
||||
type: {
|
||||
get: function() {
|
||||
if (this._type) {
|
||||
return this._type;
|
||||
} else {
|
||||
if (this._data) {
|
||||
switch(typeof this._data) {
|
||||
case "string": return "text/plain";
|
||||
case "object": return "application/json";
|
||||
}
|
||||
}
|
||||
}
|
||||
return "text/plain";
|
||||
},
|
||||
set: function(value) {
|
||||
this._type = value;
|
||||
return this;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
|
||||
// - **data**. Typically accessed as `content.data`, reflects the content entity
|
||||
// converted into Javascript data. This can be a string, if the `type` is, say,
|
||||
// `text/plain`, but can also be a Javascript object. The conversion applied is
|
||||
// based on the `processor` attribute. The `data` attribute can also be set
|
||||
// directly, in which case the conversion will be done the other way, to infer
|
||||
// the `body` attribute.
|
||||
data: {
|
||||
get: function() {
|
||||
if (this._body) {
|
||||
return this.processor.parser(this._body);
|
||||
} else {
|
||||
return this._data;
|
||||
}
|
||||
},
|
||||
set: function(data) {
|
||||
if (this._body&&data) Errors.setDataWithBody(this);
|
||||
this._data = data;
|
||||
return this;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
|
||||
// - **body**. Typically accessed as `content.body`, reflects the content entity
|
||||
// as a UTF-8 string. It is the mirror of the `data` attribute. If you set the
|
||||
// `data` attribute, the `body` attribute will be inferred and vice-versa. If
|
||||
// you attempt to set both, an exception is raised.
|
||||
body: {
|
||||
get: function() {
|
||||
if (this._data) {
|
||||
return this.processor.stringify(this._data);
|
||||
} else {
|
||||
return this._body.toString();
|
||||
}
|
||||
},
|
||||
set: function(body) {
|
||||
if (this._data&&body) Errors.setBodyWithData(this);
|
||||
this._body = body;
|
||||
return this;
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
|
||||
// - **processor**. The functions that will be used to convert to/from `data` and
|
||||
// `body` attributes. You can add processors. The two that are built-in are for
|
||||
// `text/plain`, which is basically an identity transformation and
|
||||
// `application/json` and other JSON-based media types (including custom media
|
||||
// types with `+json`). You can add your own processors. See below.
|
||||
processor: {
|
||||
get: function() {
|
||||
var processor = Content.processors[this.type];
|
||||
if (processor) {
|
||||
return processor;
|
||||
} else {
|
||||
// Return the first processor that matches any part of the
|
||||
// content type. ex: application/vnd.foobar.baz+json will match json.
|
||||
var main = this.type.split(";")[0];
|
||||
var parts = main.split(/\+|\//);
|
||||
for (var i=0, l=parts.length; i < l; i++) {
|
||||
processor = Content.processors[parts[i]]
|
||||
}
|
||||
return processor || {parser:identity,stringify:toString};
|
||||
}
|
||||
},
|
||||
enumerable: true
|
||||
},
|
||||
|
||||
// - **length**. Typically accessed as `content.length`, returns the length in
|
||||
// bytes of the raw content entity.
|
||||
length: {
|
||||
get: function() {
|
||||
if (typeof Buffer !== 'undefined') {
|
||||
return Buffer.byteLength(this.body);
|
||||
}
|
||||
return this.body.length;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Content.processors = {};
|
||||
|
||||
// The `registerProcessor` function allows you to add your own processors to
|
||||
// convert content entities. Each processor consists of a Javascript object with
|
||||
// two properties:
|
||||
// - **parser**. The function used to parse a raw content entity and convert it
|
||||
// into a Javascript data type.
|
||||
// - **stringify**. The function used to convert a Javascript data type into a
|
||||
// raw content entity.
|
||||
Content.registerProcessor = function(types,processor) {
|
||||
|
||||
// You can pass an array of types that will trigger this processor, or just one.
|
||||
// We determine the array via duck-typing here.
|
||||
if (types.forEach) {
|
||||
types.forEach(function(type) {
|
||||
Content.processors[type] = processor;
|
||||
});
|
||||
} else {
|
||||
// If you didn't pass an array, we just use what you pass in.
|
||||
Content.processors[types] = processor;
|
||||
}
|
||||
};
|
||||
|
||||
// Register the identity processor, which is used for text-based media types.
|
||||
var identity = function(x) { return x; }
|
||||
, toString = function(x) { return x.toString(); }
|
||||
Content.registerProcessor(
|
||||
["text/html","text/plain","text"],
|
||||
{ parser: identity, stringify: toString });
|
||||
|
||||
// Register the JSON processor, which is used for JSON-based media types.
|
||||
Content.registerProcessor(
|
||||
["application/json; charset=utf-8","application/json","json"],
|
||||
{
|
||||
parser: function(string) {
|
||||
return JSON.parse(string);
|
||||
},
|
||||
stringify: function(data) {
|
||||
return JSON.stringify(data); }});
|
||||
|
||||
var qs = require('querystring');
|
||||
// Register the post processor, which is used for JSON-based media types.
|
||||
Content.registerProcessor(
|
||||
["application/x-www-form-urlencoded"],
|
||||
{ parser : qs.parse, stringify : qs.stringify });
|
||||
|
||||
// Error functions are defined separately here in an attempt to make the code
|
||||
// easier to read.
|
||||
var Errors = {
|
||||
setDataWithBody: function(object) {
|
||||
throw new Error("Attempt to set data attribute of a content object " +
|
||||
"when the body attributes was already set.");
|
||||
},
|
||||
setBodyWithData: function(object) {
|
||||
throw new Error("Attempt to set body attribute of a content object " +
|
||||
"when the data attributes was already set.");
|
||||
}
|
||||
}
|
||||
module.exports = Content;
|
2932
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/swagger-client.js
generated
vendored
Normal file
2932
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/swagger-client.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
275
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/swagger-oauth.js
generated
vendored
Normal file
275
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/swagger-oauth.js
generated
vendored
Normal file
@ -0,0 +1,275 @@
|
||||
var appName;
|
||||
var popupMask;
|
||||
var popupDialog;
|
||||
var clientId;
|
||||
var realm;
|
||||
var oauth2KeyName;
|
||||
|
||||
function handleLogin() {
|
||||
var scopes = [];
|
||||
|
||||
var auths = window.swaggerUi.api.authSchemes || window.swaggerUi.api.securityDefinitions;
|
||||
if(auths) {
|
||||
var key;
|
||||
var defs = auths;
|
||||
for(key in defs) {
|
||||
var auth = defs[key];
|
||||
if(auth.type === 'oauth2' && auth.scopes) {
|
||||
oauth2KeyName = key;
|
||||
var scope;
|
||||
if(Array.isArray(auth.scopes)) {
|
||||
// 1.2 support
|
||||
var i;
|
||||
for(i = 0; i < auth.scopes.length; i++) {
|
||||
scopes.push(auth.scopes[i]);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// 2.0 support
|
||||
for(scope in auth.scopes) {
|
||||
scopes.push({scope: scope, description: auth.scopes[scope]});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(window.swaggerUi.api
|
||||
&& window.swaggerUi.api.info) {
|
||||
appName = window.swaggerUi.api.info.title;
|
||||
}
|
||||
|
||||
popupDialog = $(
|
||||
[
|
||||
'<div class="api-popup-dialog">',
|
||||
'<div class="api-popup-title">Select OAuth2.0 Scopes</div>',
|
||||
'<div class="api-popup-content">',
|
||||
'<p>Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes.',
|
||||
'<a href="#">Learn how to use</a>',
|
||||
'</p>',
|
||||
'<p><strong>' + appName + '</strong> API requires the following scopes. Select which ones you want to grant to Swagger UI.</p>',
|
||||
'<ul class="api-popup-scopes">',
|
||||
'</ul>',
|
||||
'<p class="error-msg"></p>',
|
||||
'<div class="api-popup-actions"><button class="api-popup-authbtn api-button green" type="button">Authorize</button><button class="api-popup-cancel api-button gray" type="button">Cancel</button></div>',
|
||||
'</div>',
|
||||
'</div>'].join(''));
|
||||
$(document.body).append(popupDialog);
|
||||
|
||||
popup = popupDialog.find('ul.api-popup-scopes').empty();
|
||||
for (i = 0; i < scopes.length; i ++) {
|
||||
scope = scopes[i];
|
||||
str = '<li><input type="checkbox" id="scope_' + i + '" scope="' + scope.scope + '"/>' + '<label for="scope_' + i + '">' + scope.scope;
|
||||
if (scope.description) {
|
||||
str += '<br/><span class="api-scope-desc">' + scope.description + '</span>';
|
||||
}
|
||||
str += '</label></li>';
|
||||
popup.append(str);
|
||||
}
|
||||
|
||||
var $win = $(window),
|
||||
dw = $win.width(),
|
||||
dh = $win.height(),
|
||||
st = $win.scrollTop(),
|
||||
dlgWd = popupDialog.outerWidth(),
|
||||
dlgHt = popupDialog.outerHeight(),
|
||||
top = (dh -dlgHt)/2 + st,
|
||||
left = (dw - dlgWd)/2;
|
||||
|
||||
popupDialog.css({
|
||||
top: (top < 0? 0 : top) + 'px',
|
||||
left: (left < 0? 0 : left) + 'px'
|
||||
});
|
||||
|
||||
popupDialog.find('button.api-popup-cancel').click(function() {
|
||||
popupMask.hide();
|
||||
popupDialog.hide();
|
||||
popupDialog.empty();
|
||||
popupDialog = [];
|
||||
});
|
||||
|
||||
$('button.api-popup-authbtn').unbind();
|
||||
popupDialog.find('button.api-popup-authbtn').click(function() {
|
||||
popupMask.hide();
|
||||
popupDialog.hide();
|
||||
|
||||
var authSchemes = window.swaggerUi.api.authSchemes;
|
||||
var host = window.location;
|
||||
var pathname = location.pathname.substring(0, location.pathname.lastIndexOf("/"));
|
||||
var redirectUrl = host.protocol + '//' + host.host + pathname + '/o2c.html';
|
||||
var url = null;
|
||||
|
||||
for (var key in authSchemes) {
|
||||
if (authSchemes.hasOwnProperty(key)) {
|
||||
var flow = authSchemes[key].flow;
|
||||
|
||||
if(authSchemes[key].type === 'oauth2' && flow && (flow === 'implicit' || flow === 'accessCode')) {
|
||||
var dets = authSchemes[key];
|
||||
url = dets.authorizationUrl + '?response_type=' + (flow === 'implicit' ? 'token' : 'code');
|
||||
window.swaggerUi.tokenName = dets.tokenName || 'access_token';
|
||||
window.swaggerUi.tokenUrl = (flow === 'accessCode' ? dets.tokenUrl : null);
|
||||
}
|
||||
else if(authSchemes[key].grantTypes) {
|
||||
// 1.2 support
|
||||
var o = authSchemes[key].grantTypes;
|
||||
for(var t in o) {
|
||||
if(o.hasOwnProperty(t) && t === 'implicit') {
|
||||
var dets = o[t];
|
||||
var ep = dets.loginEndpoint.url;
|
||||
url = dets.loginEndpoint.url + '?response_type=token';
|
||||
window.swaggerUi.tokenName = dets.tokenName;
|
||||
}
|
||||
else if (o.hasOwnProperty(t) && t === 'accessCode') {
|
||||
var dets = o[t];
|
||||
var ep = dets.tokenRequestEndpoint.url;
|
||||
url = dets.tokenRequestEndpoint.url + '?response_type=code';
|
||||
window.swaggerUi.tokenName = dets.tokenName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
var scopes = []
|
||||
var o = $('.api-popup-scopes').find('input:checked');
|
||||
|
||||
for(k =0; k < o.length; k++) {
|
||||
var scope = $(o[k]).attr('scope');
|
||||
|
||||
if (scopes.indexOf(scope) === -1)
|
||||
scopes.push(scope);
|
||||
}
|
||||
|
||||
window.enabledScopes=scopes;
|
||||
|
||||
url += '&redirect_uri=' + encodeURIComponent(redirectUrl);
|
||||
url += '&realm=' + encodeURIComponent(realm);
|
||||
url += '&client_id=' + encodeURIComponent(clientId);
|
||||
url += '&scope=' + encodeURIComponent(scopes);
|
||||
|
||||
window.open(url);
|
||||
});
|
||||
|
||||
popupMask.show();
|
||||
popupDialog.show();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
function handleLogout() {
|
||||
for(key in window.authorizations.authz){
|
||||
window.authorizations.remove(key)
|
||||
}
|
||||
window.enabledScopes = null;
|
||||
$('.api-ic.ic-on').addClass('ic-off');
|
||||
$('.api-ic.ic-on').removeClass('ic-on');
|
||||
|
||||
// set the info box
|
||||
$('.api-ic.ic-warning').addClass('ic-error');
|
||||
$('.api-ic.ic-warning').removeClass('ic-warning');
|
||||
}
|
||||
|
||||
function initOAuth(opts) {
|
||||
var o = (opts||{});
|
||||
var errors = [];
|
||||
|
||||
appName = (o.appName||errors.push('missing appName'));
|
||||
popupMask = (o.popupMask||$('#api-common-mask'));
|
||||
popupDialog = (o.popupDialog||$('.api-popup-dialog'));
|
||||
clientId = (o.clientId||errors.push('missing client id'));
|
||||
realm = (o.realm||errors.push('missing realm'));
|
||||
|
||||
if(errors.length > 0){
|
||||
log('auth unable initialize oauth: ' + errors);
|
||||
return;
|
||||
}
|
||||
|
||||
$('pre code').each(function(i, e) {hljs.highlightBlock(e)});
|
||||
$('.api-ic').unbind();
|
||||
$('.api-ic').click(function(s) {
|
||||
if($(s.target).hasClass('ic-off'))
|
||||
handleLogin();
|
||||
else {
|
||||
handleLogout();
|
||||
}
|
||||
false;
|
||||
});
|
||||
}
|
||||
|
||||
function processOAuthCode(data) {
|
||||
var params = {
|
||||
'client_id': clientId,
|
||||
'code': data.code,
|
||||
'grant_type': 'authorization_code'
|
||||
}
|
||||
$.ajax(
|
||||
{
|
||||
url : window.swaggerUi.tokenUrl,
|
||||
type: "POST",
|
||||
data: params,
|
||||
success:function(data, textStatus, jqXHR)
|
||||
{
|
||||
onOAuthComplete(data);
|
||||
},
|
||||
error: function(jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
onOAuthComplete("");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function onOAuthComplete(token) {
|
||||
if(token) {
|
||||
if(token.error) {
|
||||
var checkbox = $('input[type=checkbox],.secured')
|
||||
checkbox.each(function(pos){
|
||||
checkbox[pos].checked = false;
|
||||
});
|
||||
alert(token.error);
|
||||
}
|
||||
else {
|
||||
var b = token[window.swaggerUi.tokenName];
|
||||
if(b){
|
||||
// if all roles are satisfied
|
||||
var o = null;
|
||||
$.each($('.auth #api_information_panel'), function(k, v) {
|
||||
var children = v;
|
||||
if(children && children.childNodes) {
|
||||
var requiredScopes = [];
|
||||
$.each((children.childNodes), function (k1, v1){
|
||||
var inner = v1.innerHTML;
|
||||
if(inner)
|
||||
requiredScopes.push(inner);
|
||||
});
|
||||
var diff = [];
|
||||
for(var i=0; i < requiredScopes.length; i++) {
|
||||
var s = requiredScopes[i];
|
||||
if(window.enabledScopes && window.enabledScopes.indexOf(s) == -1) {
|
||||
diff.push(s);
|
||||
}
|
||||
}
|
||||
if(diff.length > 0){
|
||||
o = v.parentNode;
|
||||
$(o.parentNode).find('.api-ic.ic-on').addClass('ic-off');
|
||||
$(o.parentNode).find('.api-ic.ic-on').removeClass('ic-on');
|
||||
|
||||
// sorry, not all scopes are satisfied
|
||||
$(o).find('.api-ic').addClass('ic-warning');
|
||||
$(o).find('.api-ic').removeClass('ic-error');
|
||||
}
|
||||
else {
|
||||
o = v.parentNode;
|
||||
$(o.parentNode).find('.api-ic.ic-off').addClass('ic-on');
|
||||
$(o.parentNode).find('.api-ic.ic-off').removeClass('ic-off');
|
||||
|
||||
// all scopes are satisfied
|
||||
$(o).find('.api-ic').addClass('ic-info');
|
||||
$(o).find('.api-ic').removeClass('ic-warning');
|
||||
$(o).find('.api-ic').removeClass('ic-error');
|
||||
}
|
||||
}
|
||||
});
|
||||
window.authorizations.add(oauth2KeyName, new ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
1695
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/swagger.js
generated
vendored
Normal file
1695
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/swagger.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
6
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/underscore-min.js
generated
vendored
Normal file
6
vendor/k8s.io/kubernetes/third_party/swagger-ui/lib/underscore-min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user