Authorize user-id to role mappings for JIT access
post
/v1/projects/{ref}/database/jitAuthorizes the request to assume a role in the project database
OAuth scopes
- database:read
The fine-grained token must include the following permissions to access this endpoint:
- database_jit_read
Path parameters
- refRequiredstring
Project ref
Body
- roleRequiredstring
- rhostRequiredany of the following options
Response codes
- 200
- 401
- 403
- 429
- 500
Response (200)
1{2 "user_id": "00000000-0000-0000-0000-000000000000",3 "act": "lorem",4 "user_role": {5 "role": "lorem",6 "expires_at": 42,7 "allowed_networks": {8 "allowed_cidrs": [9 {10 "cidr": "144.144.144.144/14"11 }12 ],13 "allowed_cidrs_v6": [14 {15 "cidr": "::/104"16 }17 ]18 },19 "branches_only": true20 }21}1{2 "type": "object",3 "properties": {4 "user_id": {5 "type": "string",6 "format": "uuid",7 "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"8 },9 "act": {10 "type": "string"11 },12 "user_role": {13 "type": "object",14 "properties": {15 "role": {16 "type": "string"17 },18 "expires_at": {19 "type": "number"20 },21 "allowed_networks": {22 "type": "object",23 "properties": {24 "allowed_cidrs": {25 "type": "array",26 "items": {27 "type": "object",28 "properties": {29 "cidr": {30 "type": "string",31 "format": "cidrv4",32 "pattern": "^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$"33 }34 },35 "required": [36 "cidr"37 ]38 }39 },40 "allowed_cidrs_v6": {41 "type": "array",42 "items": {43 "type": "object",44 "properties": {45 "cidr": {46 "type": "string",47 "format": "cidrv6",48 "pattern": "^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$"49 }50 },51 "required": [52 "cidr"53 ]54 }55 }56 }57 },58 "branches_only": {59 "type": "boolean"60 }61 },62 "required": [63 "role"64 ]65 }66 },67 "required": [68 "user_role"69 ]70}