forked from sr2/cloud-api
feat: fully defined response code descriptions
Only done on three endpoints. This is a lot of repeated text.
This commit is contained in:
parent
c2e035dede
commit
5d122a7690
4 changed files with 109 additions and 5 deletions
|
|
@ -157,9 +157,56 @@ async def can_act_on_resource(
|
|||
status_code=status.HTTP_200_OK,
|
||||
response_model=IAMGetGroupPermissionsResponse,
|
||||
responses={
|
||||
status.HTTP_422_UNPROCESSABLE_CONTENT: {
|
||||
"description": "Unprocessable content.",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"org_id": {"summary": "Invalid or missing org ID."},
|
||||
"oidc_claims": {"summary": "Invalid or missing OIDC claims."},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
status.HTTP_401_UNAUTHORIZED: {
|
||||
"description": "Group does not belong to this organisation"
|
||||
}
|
||||
"description": "Unauthorized",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"awaiting_approval": {
|
||||
"summary": "Organisation has not yet been approved."
|
||||
},
|
||||
"expired_token": {"summary": "User token has expired."},
|
||||
"oidc": {"summary": "Failed to verify OIDC claims."},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
status.HTTP_403_FORBIDDEN: {
|
||||
"description": "Forbidden",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"not_root": {"summary": "Not authorised. Must be root user."},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
status.HTTP_404_NOT_FOUND: {
|
||||
"description": "Not found",
|
||||
"content": {
|
||||
"application/json": {
|
||||
"examples": {
|
||||
"db_id": {
|
||||
"summary": "User not found in db when checking claims."
|
||||
},
|
||||
"user_model": {"summary": "User model not found in db."},
|
||||
"org_model": {"summary": "Org model not found in db."},
|
||||
"group_model": {"summary": "Group model not found in db."},
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
)
|
||||
async def get_group_permissions(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue