Add api_scope target for IAM policy

This commit is contained in:
garrettmills
2020-05-20 21:17:07 -05:00
parent faab948a6b
commit b526b8f24d
6 changed files with 72 additions and 11 deletions

View File

@@ -130,7 +130,7 @@ class ReflectController extends Controller {
return res.api()
}
async get_scopes(req, res, next) {
api_scopes() {
const routers = this.routers.canonical_items
const scopes = []
@@ -158,6 +158,11 @@ class ReflectController extends Controller {
}
scopes.sort()
return scopes
}
async get_scopes(req, res, next) {
const scopes = this.api_scopes()
return res.api(scopes.map(x => {
return { scope: x }
}))