dsh 0.2.0-rc.2: in-container update (experimental channel), path-agnostic compose, upstream patches adapted to 0.1.x/0.2.x
This commit is contained in:
commit
e6dcef9bf5
302 files changed
+75178
No files matched your search
@@ -0,0 +1,12 @@
|
||||
export async function consumeInternalCapability(access, { token, audience, method, target }) {
|
||||
try {
|
||||
const result = await access.request('POST', '/v1/capabilities/consume', {
|
||||
token, audience, method, target,
|
||||
})
|
||||
return result.authorized === true
|
||||
} catch (error) {
|
||||
if (error?.statusCode === 401) return false
|
||||
if (!Number.isInteger(error?.statusCode) || error.statusCode >= 500) error.statusCode = 503
|
||||
throw error
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user