|
24 | 24 | "CoderSessionToken": []
|
25 | 25 | }
|
26 | 26 | ],
|
27 |
| - "produces": ["application/json"], |
28 | 27 | "tags": ["Applications"],
|
29 | 28 | "summary": "Redirect to URI with encrypted API key",
|
30 | 29 | "operationId": "redirect-to-uri-with-encrypted-api-key",
|
|
64 | 63 | }
|
65 | 64 | }
|
66 | 65 | },
|
| 66 | + "/authcheck": { |
| 67 | + "post": { |
| 68 | + "security": [ |
| 69 | + { |
| 70 | + "CoderSessionToken": [] |
| 71 | + } |
| 72 | + ], |
| 73 | + "produces": ["application/json"], |
| 74 | + "tags": ["Authorization"], |
| 75 | + "summary": "Check authorization", |
| 76 | + "operationId": "check-authorization", |
| 77 | + "parameters": [ |
| 78 | + { |
| 79 | + "description": "Authorization request", |
| 80 | + "name": "request", |
| 81 | + "in": "body", |
| 82 | + "required": true, |
| 83 | + "schema": { |
| 84 | + "$ref": "#/definitions/codersdk.AuthorizationRequest" |
| 85 | + } |
| 86 | + } |
| 87 | + ], |
| 88 | + "responses": { |
| 89 | + "200": { |
| 90 | + "description": "OK", |
| 91 | + "schema": { |
| 92 | + "$ref": "#/definitions/codersdk.AuthorizationResponse" |
| 93 | + } |
| 94 | + } |
| 95 | + } |
| 96 | + } |
| 97 | + }, |
67 | 98 | "/organizations/{organization-id}/templates/": {
|
68 | 99 | "post": {
|
69 | 100 | "security": [
|
|
602 | 633 | }
|
603 | 634 | },
|
604 | 635 | "definitions": {
|
| 636 | + "codersdk.AuthorizationCheck": { |
| 637 | + "type": "object", |
| 638 | + "properties": { |
| 639 | + "action": { |
| 640 | + "description": "Action can be `create`, `read`, `update`, or `delete`", |
| 641 | + "type": "string", |
| 642 | + "enum": ["create", "read", "update", "delete"] |
| 643 | + }, |
| 644 | + "object": { |
| 645 | + "description": "Object can represent a \"set\" of objects, such as:\n\t- All workspaces in an organization\n\t- All workspaces owned by me\n\t- All workspaces across the entire product\nWhen defining an object, use the most specific language when possible to\nproduce the smallest set. Meaning to set as many fields on 'Object' as\nyou can. Example, if you want to check if you can update all workspaces\nowned by 'me', try to also add an 'OrganizationID' to the settings.\nOmitting the 'OrganizationID' could produce the incorrect value, as\nworkspaces have both `user` and `organization` owners.", |
| 646 | + "$ref": "#/definitions/codersdk.AuthorizationObject" |
| 647 | + } |
| 648 | + } |
| 649 | + }, |
| 650 | + "codersdk.AuthorizationObject": { |
| 651 | + "type": "object", |
| 652 | + "properties": { |
| 653 | + "organization_id": { |
| 654 | + "description": "OrganizationID (optional) is an organization_id. It adds the set constraint to\nall resources owned by a given organization.", |
| 655 | + "type": "string" |
| 656 | + }, |
| 657 | + "owner_id": { |
| 658 | + "description": "OwnerID (optional) is a user_id. It adds the set constraint to all resources owned\nby a given user.", |
| 659 | + "type": "string" |
| 660 | + }, |
| 661 | + "resource_id": { |
| 662 | + "description": "ResourceID (optional) reduces the set to a singular resource. This assigns\na resource ID to the resource type, eg: a single workspace.\nThe rbac library will not fetch the resource from the database, so if you\nare using this option, you should also set the 'OwnerID' and 'OrganizationID'\nif possible. Be as specific as possible using all the fields relevant.", |
| 663 | + "type": "string" |
| 664 | + }, |
| 665 | + "resource_type": { |
| 666 | + "description": "ResourceType is the name of the resource.\n`./coderd/rbac/object.go` has the list of valid resource types.", |
| 667 | + "type": "string" |
| 668 | + } |
| 669 | + } |
| 670 | + }, |
| 671 | + "codersdk.AuthorizationRequest": { |
| 672 | + "type": "object", |
| 673 | + "properties": { |
| 674 | + "checks": { |
| 675 | + "description": "Checks is a map keyed with an arbitrary string to a permission check.\nThe key can be any string that is helpful to the caller, and allows\nmultiple permission checks to be run in a single request.\nThe key ensures that each permission check has the same key in the\nresponse.", |
| 676 | + "type": "object", |
| 677 | + "additionalProperties": { |
| 678 | + "$ref": "#/definitions/codersdk.AuthorizationCheck" |
| 679 | + } |
| 680 | + } |
| 681 | + } |
| 682 | + }, |
| 683 | + "codersdk.AuthorizationResponse": { |
| 684 | + "type": "object", |
| 685 | + "additionalProperties": { |
| 686 | + "type": "boolean" |
| 687 | + } |
| 688 | + }, |
605 | 689 | "codersdk.CreateParameterRequest": {
|
606 | 690 | "type": "object",
|
607 | 691 | "required": [
|
|
0 commit comments