rswag-ui-2.1 2.9.1.ruby21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/Rakefile +27 -0
- data/lib/generators/rswag/ui/custom/USAGE +8 -0
- data/lib/generators/rswag/ui/custom/custom_generator.rb +13 -0
- data/lib/generators/rswag/ui/install/USAGE +8 -0
- data/lib/generators/rswag/ui/install/install_generator.rb +18 -0
- data/lib/generators/rswag/ui/install/templates/rswag_ui.rb +16 -0
- data/lib/rswag/ui/basic_auth.rb +31 -0
- data/lib/rswag/ui/configuration.rb +44 -0
- data/lib/rswag/ui/engine.rb +25 -0
- data/lib/rswag/ui/index.erb +103 -0
- data/lib/rswag/ui/middleware.rb +54 -0
- data/lib/rswag/ui.rb +14 -0
- data/lib/tasks/rswag-ui_tasks.rake +12 -0
- data/node_modules/swagger-ui-dist/LICENSE +202 -0
- data/node_modules/swagger-ui-dist/NOTICE +2 -0
- data/node_modules/swagger-ui-dist/README.md +22 -0
- data/node_modules/swagger-ui-dist/absolute-path.js +14 -0
- data/node_modules/swagger-ui-dist/favicon-16x16.png +0 -0
- data/node_modules/swagger-ui-dist/favicon-32x32.png +0 -0
- data/node_modules/swagger-ui-dist/index.html +60 -0
- data/node_modules/swagger-ui-dist/index.js +17 -0
- data/node_modules/swagger-ui-dist/oauth2-redirect.html +75 -0
- data/node_modules/swagger-ui-dist/package.json +18 -0
- data/node_modules/swagger-ui-dist/swagger-ui-bundle.js +3 -0
- data/node_modules/swagger-ui-dist/swagger-ui-bundle.js.map +1 -0
- data/node_modules/swagger-ui-dist/swagger-ui-es-bundle-core.js +3 -0
- data/node_modules/swagger-ui-dist/swagger-ui-es-bundle-core.js.map +1 -0
- data/node_modules/swagger-ui-dist/swagger-ui-es-bundle.js +3 -0
- data/node_modules/swagger-ui-dist/swagger-ui-es-bundle.js.map +1 -0
- data/node_modules/swagger-ui-dist/swagger-ui-standalone-preset.js +3 -0
- data/node_modules/swagger-ui-dist/swagger-ui-standalone-preset.js.map +1 -0
- data/node_modules/swagger-ui-dist/swagger-ui.css +4 -0
- data/node_modules/swagger-ui-dist/swagger-ui.css.map +1 -0
- data/node_modules/swagger-ui-dist/swagger-ui.js +3 -0
- data/node_modules/swagger-ui-dist/swagger-ui.js.map +1 -0
- metadata +138 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<!-- HTML for static distribution bundle build -->
|
|
2
|
+
<!DOCTYPE html>
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="UTF-8">
|
|
6
|
+
<title>Swagger UI</title>
|
|
7
|
+
<link rel="stylesheet" type="text/css" href="./swagger-ui.css" />
|
|
8
|
+
<link rel="icon" type="image/png" href="./favicon-32x32.png" sizes="32x32" />
|
|
9
|
+
<link rel="icon" type="image/png" href="./favicon-16x16.png" sizes="16x16" />
|
|
10
|
+
<style>
|
|
11
|
+
html
|
|
12
|
+
{
|
|
13
|
+
box-sizing: border-box;
|
|
14
|
+
overflow: -moz-scrollbars-vertical;
|
|
15
|
+
overflow-y: scroll;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
*,
|
|
19
|
+
*:before,
|
|
20
|
+
*:after
|
|
21
|
+
{
|
|
22
|
+
box-sizing: inherit;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
body
|
|
26
|
+
{
|
|
27
|
+
margin:0;
|
|
28
|
+
background: #fafafa;
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
31
|
+
</head>
|
|
32
|
+
|
|
33
|
+
<body>
|
|
34
|
+
<div id="swagger-ui"></div>
|
|
35
|
+
|
|
36
|
+
<script src="./swagger-ui-bundle.js" charset="UTF-8"> </script>
|
|
37
|
+
<script src="./swagger-ui-standalone-preset.js" charset="UTF-8"> </script>
|
|
38
|
+
<script>
|
|
39
|
+
window.onload = function() {
|
|
40
|
+
// Begin Swagger UI call region
|
|
41
|
+
const ui = SwaggerUIBundle({
|
|
42
|
+
url: "https://petstore.swagger.io/v2/swagger.json",
|
|
43
|
+
dom_id: '#swagger-ui',
|
|
44
|
+
deepLinking: true,
|
|
45
|
+
presets: [
|
|
46
|
+
SwaggerUIBundle.presets.apis,
|
|
47
|
+
SwaggerUIStandalonePreset
|
|
48
|
+
],
|
|
49
|
+
plugins: [
|
|
50
|
+
SwaggerUIBundle.plugins.DownloadUrl
|
|
51
|
+
],
|
|
52
|
+
layout: "StandaloneLayout"
|
|
53
|
+
});
|
|
54
|
+
// End Swagger UI call region
|
|
55
|
+
|
|
56
|
+
window.ui = ui;
|
|
57
|
+
};
|
|
58
|
+
</script>
|
|
59
|
+
</body>
|
|
60
|
+
</html>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
try {
|
|
2
|
+
module.exports.SwaggerUIBundle = require("./swagger-ui-bundle.js")
|
|
3
|
+
module.exports.SwaggerUIStandalonePreset = require("./swagger-ui-standalone-preset.js")
|
|
4
|
+
} catch(e) {
|
|
5
|
+
// swallow the error if there's a problem loading the assets.
|
|
6
|
+
// allows this module to support providing the assets for browserish contexts,
|
|
7
|
+
// without exploding in a Node context.
|
|
8
|
+
//
|
|
9
|
+
// see https://github.com/swagger-api/swagger-ui/issues/3291#issuecomment-311195388
|
|
10
|
+
// for more information.
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// `absolutePath` and `getAbsoluteFSPath` are both here because at one point,
|
|
14
|
+
// we documented having one and actually implemented the other.
|
|
15
|
+
// They were both retained so we don't break anyone's code.
|
|
16
|
+
module.exports.absolutePath = require("./absolute-path.js")
|
|
17
|
+
module.exports.getAbsoluteFSPath = require("./absolute-path.js")
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en-US">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Swagger UI: OAuth2 Redirect</title>
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
<script>
|
|
8
|
+
'use strict';
|
|
9
|
+
function run () {
|
|
10
|
+
var oauth2 = window.opener.swaggerUIRedirectOauth2;
|
|
11
|
+
var sentState = oauth2.state;
|
|
12
|
+
var redirectUrl = oauth2.redirectUrl;
|
|
13
|
+
var isValid, qp, arr;
|
|
14
|
+
|
|
15
|
+
if (/code|token|error/.test(window.location.hash)) {
|
|
16
|
+
qp = window.location.hash.substring(1);
|
|
17
|
+
} else {
|
|
18
|
+
qp = location.search.substring(1);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
arr = qp.split("&");
|
|
22
|
+
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';});
|
|
23
|
+
qp = qp ? JSON.parse('{' + arr.join() + '}',
|
|
24
|
+
function (key, value) {
|
|
25
|
+
return key === "" ? value : decodeURIComponent(value);
|
|
26
|
+
}
|
|
27
|
+
) : {};
|
|
28
|
+
|
|
29
|
+
isValid = qp.state === sentState;
|
|
30
|
+
|
|
31
|
+
if ((
|
|
32
|
+
oauth2.auth.schema.get("flow") === "accessCode" ||
|
|
33
|
+
oauth2.auth.schema.get("flow") === "authorizationCode" ||
|
|
34
|
+
oauth2.auth.schema.get("flow") === "authorization_code"
|
|
35
|
+
) && !oauth2.auth.code) {
|
|
36
|
+
if (!isValid) {
|
|
37
|
+
oauth2.errCb({
|
|
38
|
+
authId: oauth2.auth.name,
|
|
39
|
+
source: "auth",
|
|
40
|
+
level: "warning",
|
|
41
|
+
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (qp.code) {
|
|
46
|
+
delete oauth2.state;
|
|
47
|
+
oauth2.auth.code = qp.code;
|
|
48
|
+
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl});
|
|
49
|
+
} else {
|
|
50
|
+
let oauthErrorMsg;
|
|
51
|
+
if (qp.error) {
|
|
52
|
+
oauthErrorMsg = "["+qp.error+"]: " +
|
|
53
|
+
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") +
|
|
54
|
+
(qp.error_uri ? "More info: "+qp.error_uri : "");
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
oauth2.errCb({
|
|
58
|
+
authId: oauth2.auth.name,
|
|
59
|
+
source: "auth",
|
|
60
|
+
level: "error",
|
|
61
|
+
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server"
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
} else {
|
|
65
|
+
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl});
|
|
66
|
+
}
|
|
67
|
+
window.close();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
window.addEventListener('DOMContentLoaded', function () {
|
|
71
|
+
run();
|
|
72
|
+
});
|
|
73
|
+
</script>
|
|
74
|
+
</body>
|
|
75
|
+
</html>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "swagger-ui-dist",
|
|
3
|
+
"version": "4.1.3",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"repository": "git@github.com:swagger-api/swagger-ui.git",
|
|
6
|
+
"contributors": [
|
|
7
|
+
"(in alphabetical order)",
|
|
8
|
+
"Anna Bodnia <anna.bodnia@gmail.com>",
|
|
9
|
+
"Buu Nguyen <buunguyen@gmail.com>",
|
|
10
|
+
"Josh Ponelat <jponelat@gmail.com>",
|
|
11
|
+
"Kyle Shockey <kyleshockey1@gmail.com>",
|
|
12
|
+
"Robert Barnwell <robert@robertismy.name>",
|
|
13
|
+
"Sahar Jafari <shr.jafari@gmail.com>"
|
|
14
|
+
],
|
|
15
|
+
"license": "Apache-2.0",
|
|
16
|
+
"dependencies": {},
|
|
17
|
+
"devDependencies": {}
|
|
18
|
+
}
|