ddangelorb
3 years ago
17 changed files with 590 additions and 0 deletions
-
BINdist/favicon-16x16.png
-
BINdist/favicon-32x32.png
-
75dist/oauth2-redirect.html
-
3dist/swagger-ui-bundle.js
-
1dist/swagger-ui-bundle.js.map
-
3dist/swagger-ui-es-bundle-core.js
-
1dist/swagger-ui-es-bundle-core.js.map
-
3dist/swagger-ui-es-bundle.js
-
1dist/swagger-ui-es-bundle.js.map
-
3dist/swagger-ui-standalone-preset.js
-
1dist/swagger-ui-standalone-preset.js.map
-
4dist/swagger-ui.css
-
1dist/swagger-ui.css.map
-
3dist/swagger-ui.js
-
1dist/swagger-ui.js.map
-
59index.html
-
431swagger.json
After Width: 16 | Height: 16 | Size: 665 B |
After Width: 32 | Height: 32 | Size: 628 B |
@ -0,0 +1,75 @@ |
|||||
|
<!doctype html> |
||||
|
<html lang="en-US"> |
||||
|
<head> |
||||
|
<title>Swagger UI: OAuth2 Redirect</title> |
||||
|
</head> |
||||
|
<body> |
||||
|
<script> |
||||
|
'use strict'; |
||||
|
function run () { |
||||
|
var oauth2 = window.opener.swaggerUIRedirectOauth2; |
||||
|
var sentState = oauth2.state; |
||||
|
var redirectUrl = oauth2.redirectUrl; |
||||
|
var isValid, qp, arr; |
||||
|
|
||||
|
if (/code|token|error/.test(window.location.hash)) { |
||||
|
qp = window.location.hash.substring(1); |
||||
|
} else { |
||||
|
qp = location.search.substring(1); |
||||
|
} |
||||
|
|
||||
|
arr = qp.split("&"); |
||||
|
arr.forEach(function (v,i,_arr) { _arr[i] = '"' + v.replace('=', '":"') + '"';}); |
||||
|
qp = qp ? JSON.parse('{' + arr.join() + '}', |
||||
|
function (key, value) { |
||||
|
return key === "" ? value : decodeURIComponent(value); |
||||
|
} |
||||
|
) : {}; |
||||
|
|
||||
|
isValid = qp.state === sentState; |
||||
|
|
||||
|
if (( |
||||
|
oauth2.auth.schema.get("flow") === "accessCode" || |
||||
|
oauth2.auth.schema.get("flow") === "authorizationCode" || |
||||
|
oauth2.auth.schema.get("flow") === "authorization_code" |
||||
|
) && !oauth2.auth.code) { |
||||
|
if (!isValid) { |
||||
|
oauth2.errCb({ |
||||
|
authId: oauth2.auth.name, |
||||
|
source: "auth", |
||||
|
level: "warning", |
||||
|
message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server" |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
if (qp.code) { |
||||
|
delete oauth2.state; |
||||
|
oauth2.auth.code = qp.code; |
||||
|
oauth2.callback({auth: oauth2.auth, redirectUrl: redirectUrl}); |
||||
|
} else { |
||||
|
let oauthErrorMsg; |
||||
|
if (qp.error) { |
||||
|
oauthErrorMsg = "["+qp.error+"]: " + |
||||
|
(qp.error_description ? qp.error_description+ ". " : "no accessCode received from the server. ") + |
||||
|
(qp.error_uri ? "More info: "+qp.error_uri : ""); |
||||
|
} |
||||
|
|
||||
|
oauth2.errCb({ |
||||
|
authId: oauth2.auth.name, |
||||
|
source: "auth", |
||||
|
level: "error", |
||||
|
message: oauthErrorMsg || "[Authorization failed]: no accessCode received from the server" |
||||
|
}); |
||||
|
} |
||||
|
} else { |
||||
|
oauth2.callback({auth: oauth2.auth, token: qp, isValid: isValid, redirectUrl: redirectUrl}); |
||||
|
} |
||||
|
window.close(); |
||||
|
} |
||||
|
|
||||
|
window.addEventListener('DOMContentLoaded', function () { |
||||
|
run(); |
||||
|
}); |
||||
|
</script> |
||||
|
</body> |
||||
|
</html> |
3
dist/swagger-ui-bundle.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
dist/swagger-ui-bundle.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
3
dist/swagger-ui-es-bundle-core.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
dist/swagger-ui-es-bundle-core.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
3
dist/swagger-ui-es-bundle.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
dist/swagger-ui-es-bundle.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
3
dist/swagger-ui-standalone-preset.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
dist/swagger-ui-standalone-preset.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
4
dist/swagger-ui.css
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
dist/swagger-ui.css.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
3
dist/swagger-ui.js
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1
dist/swagger-ui.js.map
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,59 @@ |
|||||
|
<!-- HTML for static distribution bundle build --> |
||||
|
<!DOCTYPE html> |
||||
|
<html lang="en"> |
||||
|
|
||||
|
<head> |
||||
|
<meta charset="UTF-8"> |
||||
|
<title>Swagger UI</title> |
||||
|
<link rel="stylesheet" type="text/css" href="dist/swagger-ui.css" /> |
||||
|
<link rel="icon" type="image/png" href="dist/favicon-32x32.png" sizes="32x32" /> |
||||
|
<link rel="icon" type="image/png" href="dist/favicon-16x16.png" sizes="16x16" /> |
||||
|
<style> |
||||
|
html { |
||||
|
box-sizing: border-box; |
||||
|
overflow: -moz-scrollbars-vertical; |
||||
|
overflow-y: scroll; |
||||
|
} |
||||
|
|
||||
|
*, |
||||
|
*:before, |
||||
|
*:after { |
||||
|
box-sizing: inherit; |
||||
|
} |
||||
|
|
||||
|
body { |
||||
|
margin: 0; |
||||
|
background: #fafafa; |
||||
|
} |
||||
|
</style> |
||||
|
</head> |
||||
|
|
||||
|
<body> |
||||
|
<div id="swagger-ui"></div> |
||||
|
|
||||
|
<script src="dist/swagger-ui-bundle.js" charset="UTF-8"> </script> |
||||
|
<script src="dist/swagger-ui-standalone-preset.js" charset="UTF-8"> </script> |
||||
|
<script> |
||||
|
window.onload = function () { |
||||
|
// Begin Swagger UI call region |
||||
|
const ui = SwaggerUIBundle({ |
||||
|
url: "swagger.json", |
||||
|
dom_id: '#swagger-ui', |
||||
|
deepLinking: true, |
||||
|
presets: [ |
||||
|
SwaggerUIBundle.presets.apis, |
||||
|
SwaggerUIStandalonePreset |
||||
|
], |
||||
|
plugins: [ |
||||
|
SwaggerUIBundle.plugins.DownloadUrl |
||||
|
], |
||||
|
layout: "StandaloneLayout" |
||||
|
}); |
||||
|
// End Swagger UI call region |
||||
|
|
||||
|
window.ui = ui; |
||||
|
}; |
||||
|
</script> |
||||
|
</body> |
||||
|
|
||||
|
</html> |
@ -0,0 +1,431 @@ |
|||||
|
{ |
||||
|
"swagger": "2.0", |
||||
|
"info": { |
||||
|
"description": "This is a sample JWT authentication service. You can find out more about JWT at [https://jwt.io/](https://jwt.io/). For this sample, you can use the `admin` or `client` users (password: admin and client respectively) to test the authorization filters. Once you have successfully logged in and obtained the token, you should click on the right top button `Authorize` and introduce it with the prefix \"Bearer \".", |
||||
|
"version": "1.0.0", |
||||
|
"title": "JSON Web Token Authentication API", |
||||
|
"contact": { |
||||
|
"email": "mauriurraco@gmail.com" |
||||
|
}, |
||||
|
"license": { |
||||
|
"name": "MIT License", |
||||
|
"url": "http://opensource.org/licenses/MIT" |
||||
|
} |
||||
|
}, |
||||
|
"host": "localhost:8080", |
||||
|
"basePath": "/", |
||||
|
"tags": [ |
||||
|
{ |
||||
|
"name": "users", |
||||
|
"description": "Operations about users" |
||||
|
} |
||||
|
], |
||||
|
"paths": { |
||||
|
"/users/activate": { |
||||
|
"post": { |
||||
|
"tags": [ |
||||
|
"users" |
||||
|
], |
||||
|
"summary": "${UserController.activate}", |
||||
|
"operationId": "activateUsingPOST", |
||||
|
"consumes": [ |
||||
|
"application/json" |
||||
|
], |
||||
|
"produces": [ |
||||
|
"*/*" |
||||
|
], |
||||
|
"parameters": [ |
||||
|
{ |
||||
|
"name": "activationkey", |
||||
|
"in": "path", |
||||
|
"description": "ActivationKey", |
||||
|
"required": false, |
||||
|
"type": "string" |
||||
|
}, |
||||
|
{ |
||||
|
"name": "username", |
||||
|
"in": "path", |
||||
|
"description": "Username", |
||||
|
"required": false, |
||||
|
"type": "string" |
||||
|
} |
||||
|
], |
||||
|
"responses": { |
||||
|
"200": { |
||||
|
"description": "OK", |
||||
|
"schema": { |
||||
|
"type": "string" |
||||
|
} |
||||
|
}, |
||||
|
"400": { |
||||
|
"description": "Something went wrong" |
||||
|
}, |
||||
|
"403": { |
||||
|
"description": "Access denied" |
||||
|
}, |
||||
|
"404": { |
||||
|
"description": "The user doesn't exist" |
||||
|
}, |
||||
|
"500": { |
||||
|
"description": "Expired or invalid JWT token" |
||||
|
} |
||||
|
}, |
||||
|
"security": [ |
||||
|
{ |
||||
|
"Authorization": [ |
||||
|
"global" |
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
"apiKey": [] |
||||
|
} |
||||
|
], |
||||
|
"deprecated": false |
||||
|
} |
||||
|
}, |
||||
|
"/users/me": { |
||||
|
"get": { |
||||
|
"tags": [ |
||||
|
"users" |
||||
|
], |
||||
|
"summary": "${UserController.me}", |
||||
|
"operationId": "whoamiUsingGET", |
||||
|
"produces": [ |
||||
|
"*/*" |
||||
|
], |
||||
|
"responses": { |
||||
|
"200": { |
||||
|
"description": "OK", |
||||
|
"schema": { |
||||
|
"$ref": "#/definitions/UsersResponseDTO" |
||||
|
} |
||||
|
}, |
||||
|
"400": { |
||||
|
"description": "Something went wrong" |
||||
|
}, |
||||
|
"403": { |
||||
|
"description": "Access denied" |
||||
|
}, |
||||
|
"500": { |
||||
|
"description": "Expired or invalid JWT token" |
||||
|
} |
||||
|
}, |
||||
|
"security": [ |
||||
|
{ |
||||
|
"Authorization": [ |
||||
|
"global" |
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
"apiKey": [] |
||||
|
} |
||||
|
], |
||||
|
"deprecated": false |
||||
|
} |
||||
|
}, |
||||
|
"/users/refresh": { |
||||
|
"get": { |
||||
|
"tags": [ |
||||
|
"users" |
||||
|
], |
||||
|
"summary": "refresh", |
||||
|
"operationId": "refreshUsingGET", |
||||
|
"produces": [ |
||||
|
"*/*" |
||||
|
], |
||||
|
"responses": { |
||||
|
"200": { |
||||
|
"description": "OK", |
||||
|
"schema": { |
||||
|
"type": "string" |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
"security": [ |
||||
|
{ |
||||
|
"Authorization": [ |
||||
|
"global" |
||||
|
] |
||||
|
} |
||||
|
], |
||||
|
"deprecated": false |
||||
|
} |
||||
|
}, |
||||
|
"/users/signin": { |
||||
|
"post": { |
||||
|
"tags": [ |
||||
|
"users" |
||||
|
], |
||||
|
"summary": "${UserController.signin}", |
||||
|
"operationId": "loginUsingPOST", |
||||
|
"consumes": [ |
||||
|
"application/json" |
||||
|
], |
||||
|
"produces": [ |
||||
|
"*/*" |
||||
|
], |
||||
|
"parameters": [ |
||||
|
{ |
||||
|
"name": "password", |
||||
|
"in": "query", |
||||
|
"description": "Password", |
||||
|
"required": false, |
||||
|
"type": "string", |
||||
|
"allowEmptyValue": false |
||||
|
}, |
||||
|
{ |
||||
|
"name": "username", |
||||
|
"in": "query", |
||||
|
"description": "Username", |
||||
|
"required": false, |
||||
|
"type": "string", |
||||
|
"allowEmptyValue": false |
||||
|
} |
||||
|
], |
||||
|
"responses": { |
||||
|
"200": { |
||||
|
"description": "OK", |
||||
|
"schema": { |
||||
|
"type": "string" |
||||
|
} |
||||
|
}, |
||||
|
"400": { |
||||
|
"description": "Something went wrong" |
||||
|
}, |
||||
|
"422": { |
||||
|
"description": "Invalid username/password supplied" |
||||
|
} |
||||
|
}, |
||||
|
"security": [ |
||||
|
{ |
||||
|
"Authorization": [ |
||||
|
"global" |
||||
|
] |
||||
|
} |
||||
|
], |
||||
|
"deprecated": false |
||||
|
} |
||||
|
}, |
||||
|
"/users/signup": { |
||||
|
"post": { |
||||
|
"tags": [ |
||||
|
"users" |
||||
|
], |
||||
|
"summary": "${UserController.signup}", |
||||
|
"operationId": "signupUsingPOST", |
||||
|
"consumes": [ |
||||
|
"application/json" |
||||
|
], |
||||
|
"produces": [ |
||||
|
"*/*" |
||||
|
], |
||||
|
"parameters": [ |
||||
|
{ |
||||
|
"in": "body", |
||||
|
"name": "user", |
||||
|
"description": "Signup User", |
||||
|
"required": false, |
||||
|
"schema": { |
||||
|
"$ref": "#/definitions/UsersRequestDTO" |
||||
|
} |
||||
|
} |
||||
|
], |
||||
|
"responses": { |
||||
|
"200": { |
||||
|
"description": "OK", |
||||
|
"schema": { |
||||
|
"type": "string" |
||||
|
} |
||||
|
}, |
||||
|
"400": { |
||||
|
"description": "Something went wrong" |
||||
|
}, |
||||
|
"403": { |
||||
|
"description": "Access denied" |
||||
|
}, |
||||
|
"422": { |
||||
|
"description": "Username is already in use" |
||||
|
} |
||||
|
}, |
||||
|
"security": [ |
||||
|
{ |
||||
|
"Authorization": [ |
||||
|
"global" |
||||
|
] |
||||
|
} |
||||
|
], |
||||
|
"deprecated": false |
||||
|
} |
||||
|
}, |
||||
|
"/users/{username}": { |
||||
|
"get": { |
||||
|
"tags": [ |
||||
|
"users" |
||||
|
], |
||||
|
"summary": "${UserController.search}", |
||||
|
"operationId": "searchUsingGET", |
||||
|
"produces": [ |
||||
|
"*/*" |
||||
|
], |
||||
|
"parameters": [ |
||||
|
{ |
||||
|
"name": "username", |
||||
|
"in": "path", |
||||
|
"description": "Username", |
||||
|
"required": false, |
||||
|
"type": "string" |
||||
|
} |
||||
|
], |
||||
|
"responses": { |
||||
|
"200": { |
||||
|
"description": "OK", |
||||
|
"schema": { |
||||
|
"$ref": "#/definitions/UsersResponseDTO" |
||||
|
} |
||||
|
}, |
||||
|
"400": { |
||||
|
"description": "Something went wrong" |
||||
|
}, |
||||
|
"403": { |
||||
|
"description": "Access denied" |
||||
|
}, |
||||
|
"404": { |
||||
|
"description": "The user doesn't exist" |
||||
|
}, |
||||
|
"500": { |
||||
|
"description": "Expired or invalid JWT token" |
||||
|
} |
||||
|
}, |
||||
|
"security": [ |
||||
|
{ |
||||
|
"Authorization": [ |
||||
|
"global" |
||||
|
] |
||||
|
}, |
||||
|
{ |
||||
|
"apiKey": [] |
||||
|
} |
||||
|
], |
||||
|
"deprecated": false |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
"securityDefinitions": { |
||||
|
"Authorization": { |
||||
|
"type": "apiKey", |
||||
|
"name": "Authorization", |
||||
|
"in": "header" |
||||
|
} |
||||
|
}, |
||||
|
"definitions": { |
||||
|
"EduCemadenOrganizations": { |
||||
|
"type": "object", |
||||
|
"properties": { |
||||
|
"activationkey": { |
||||
|
"type": "string" |
||||
|
}, |
||||
|
"active": { |
||||
|
"type": "string" |
||||
|
}, |
||||
|
"address": { |
||||
|
"type": "string" |
||||
|
}, |
||||
|
"creation_date": { |
||||
|
"type": "string" |
||||
|
}, |
||||
|
"id": { |
||||
|
"type": "integer", |
||||
|
"format": "int32" |
||||
|
}, |
||||
|
"inep_code": { |
||||
|
"type": "string" |
||||
|
}, |
||||
|
"login": { |
||||
|
"type": "string" |
||||
|
}, |
||||
|
"name": { |
||||
|
"type": "string" |
||||
|
}, |
||||
|
"phone": { |
||||
|
"type": "string" |
||||
|
}, |
||||
|
"responsible": { |
||||
|
"type": "string" |
||||
|
}, |
||||
|
"type": { |
||||
|
"type": "string" |
||||
|
}, |
||||
|
"website": { |
||||
|
"type": "string" |
||||
|
} |
||||
|
}, |
||||
|
"title": "EduCemadenOrganizations" |
||||
|
}, |
||||
|
"UsersRequestDTO": { |
||||
|
"type": "object", |
||||
|
"properties": { |
||||
|
"username": { |
||||
|
"type": "string" |
||||
|
}, |
||||
|
"password": { |
||||
|
"type": "string" |
||||
|
} |
||||
|
}, |
||||
|
"title": "UsersRequestDTO" |
||||
|
}, |
||||
|
"UsersResponseDTO": { |
||||
|
"type": "object", |
||||
|
"properties": { |
||||
|
"id": { |
||||
|
"type": "integer", |
||||
|
"format": "int32" |
||||
|
}, |
||||
|
"username": { |
||||
|
"type": "string" |
||||
|
}, |
||||
|
"roles": { |
||||
|
"type": "array", |
||||
|
"items": { |
||||
|
"type": "string", |
||||
|
"enum": [ |
||||
|
"ROLE_ADMIN", |
||||
|
"ROLE_INSTITUTION", |
||||
|
"ROLE_CLIENT" |
||||
|
] |
||||
|
} |
||||
|
}, |
||||
|
"eduCemadenOrganization": { |
||||
|
"$ref": "#/definitions/EduCemadenOrganizations" |
||||
|
}, |
||||
|
"rolesProviderActivationKeys": { |
||||
|
"type": "array", |
||||
|
"items": { |
||||
|
"$ref": "#/definitions/UsersRolesproviderActivationKey" |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
"title": "UsersResponseDTO" |
||||
|
}, |
||||
|
"UsersRolesproviderActivationKey": { |
||||
|
"type": "object", |
||||
|
"properties": { |
||||
|
"activationkey": { |
||||
|
"type": "string" |
||||
|
}, |
||||
|
"id": { |
||||
|
"type": "integer", |
||||
|
"format": "int32" |
||||
|
}, |
||||
|
"rolesid": { |
||||
|
"type": "integer", |
||||
|
"format": "int32" |
||||
|
}, |
||||
|
"usersid": { |
||||
|
"type": "integer", |
||||
|
"format": "int32" |
||||
|
} |
||||
|
}, |
||||
|
"title": "UsersRolesproviderActivationKey" |
||||
|
} |
||||
|
} |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue