feat: Configureer auth Swagger
This commit is contained in:
parent
e139f59afa
commit
855620cb67
5 changed files with 125 additions and 5 deletions
|
@ -17,7 +17,37 @@ const doc = {
|
|||
{
|
||||
url: 'https://sel2-1.ugent.be/api'
|
||||
}
|
||||
]
|
||||
],
|
||||
components: {
|
||||
securitySchemes: {
|
||||
student: {
|
||||
type: 'oauth2',
|
||||
flows: {
|
||||
implicit: {
|
||||
authorizationUrl: 'http://localhost:7080/realms/student/protocol/openid-connect/auth',
|
||||
scopes: {
|
||||
openid: 'openid',
|
||||
profile: 'profile',
|
||||
email: 'email'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
teacher: {
|
||||
type: 'oauth2',
|
||||
flows: {
|
||||
implicit: {
|
||||
authorizationUrl: 'http://localhost:7080/realms/teacher/protocol/openid-connect/auth',
|
||||
scopes: {
|
||||
openid: 'openid',
|
||||
profile: 'profile',
|
||||
email: 'email'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const outputFile = './swagger.json';
|
||||
|
|
|
@ -520,10 +520,10 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/login/": {
|
||||
"/auth/config": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Login"
|
||||
"Auth"
|
||||
],
|
||||
"description": "",
|
||||
"responses": {
|
||||
|
@ -533,6 +533,63 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"/auth/testAuthenticatedOnly": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Auth"
|
||||
],
|
||||
"description": "",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"student": []
|
||||
},
|
||||
{
|
||||
"teacher": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/auth/testStudentsOnly": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Auth"
|
||||
],
|
||||
"description": "",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"student": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/auth/testTeachersOnly": {
|
||||
"get": {
|
||||
"tags": [
|
||||
"Auth"
|
||||
],
|
||||
"description": "",
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "OK"
|
||||
}
|
||||
},
|
||||
"security": [
|
||||
{
|
||||
"teacher": []
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"/theme/": {
|
||||
"get": {
|
||||
"tags": [
|
||||
|
@ -708,5 +765,35 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"components": {
|
||||
"securitySchemes": {
|
||||
"student": {
|
||||
"type": "oauth2",
|
||||
"flows": {
|
||||
"implicit": {
|
||||
"authorizationUrl": "http://localhost:7080/realms/student/protocol/openid-connect/auth",
|
||||
"scopes": {
|
||||
"openid": "openid",
|
||||
"profile": "profile",
|
||||
"email": "email"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"teacher": {
|
||||
"type": "oauth2",
|
||||
"flows": {
|
||||
"implicit": {
|
||||
"authorizationUrl": "http://localhost:7080/realms/teacher/protocol/openid-connect/auth",
|
||||
"scopes": {
|
||||
"openid": "openid",
|
||||
"profile": "profile",
|
||||
"email": "email"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue