Implement OAuth2 server, link oauth:Client and auth::Oauth2Client, implement permission checks
This commit is contained in:
41
app/routing/routers/api/v1/oauth.routes.js
Normal file
41
app/routing/routers/api/v1/oauth.routes.js
Normal file
@@ -0,0 +1,41 @@
|
||||
const oauth_routes = {
|
||||
prefix: '/api/v1/oauth',
|
||||
|
||||
middleware: [
|
||||
'auth:APIRoute',
|
||||
],
|
||||
|
||||
get: {
|
||||
'/clients': [
|
||||
['middleware::api:Permission', { check: 'v1:oauth:clients:list' }],
|
||||
'controller::api:v1:OAuth.get_clients',
|
||||
],
|
||||
'/clients/:id': [
|
||||
['middleware::api:Permission', { check: 'v1:oauth:clients:get' }],
|
||||
'controller::api:v1:OAuth.get_client',
|
||||
],
|
||||
},
|
||||
|
||||
post: {
|
||||
'/clients': [
|
||||
['middleware::api:Permission', { check: 'v1:oauth:clients:create' }],
|
||||
'controller::api:v1:OAuth.create_client',
|
||||
],
|
||||
},
|
||||
|
||||
patch: {
|
||||
'/clients/:id': [
|
||||
['middleware::api:Permission', { check: 'v1:oauth:clients:update' }],
|
||||
'controller::api:v1:OAuth.update_client',
|
||||
],
|
||||
},
|
||||
|
||||
delete: {
|
||||
'/clients/:id': [
|
||||
['middleware::api:Permission', { check: 'v1:oauth:clients:delete' }],
|
||||
'controller::api:v1:OAuth.delete_client',
|
||||
],
|
||||
},
|
||||
}
|
||||
|
||||
module.exports = exports = oauth_routes
|
||||
Reference in New Issue
Block a user