-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for organization roles and rework security manager setting (
#359) * feat: add support for custom org role * add documentation, improve validation * use new role api for security managers, add project_name to GitHubOrganization, update tests and documentation * update default operations * chore: improve displaying of squash commit changes * chore: use installation model for redirection * chore: revert security_manager_role for now as you must use the predefined role to access repository advisories * chore: update config if needed * chore: add changelog entries
- Loading branch information
Showing
29 changed files
with
572 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
Definition of a custom `Role` on organization level, the following properties are supported: | ||
|
||
| Key | Value | Description | Note | | ||
|---------------|----------------|-----------------------------------------------------------|------------------------------------------------| | ||
| _name_ | string | The name of the role | | | ||
| _description_ | string | The description of the role | | | ||
| _permissions_ | list[string] | List of additional permissions | TODO | | ||
| _base_role_ | string | The system role from which this role inherits permissions | `none`, `read`, `write`, `maintain` or `admin` | | ||
|
||
## Jsonnet Function | ||
|
||
``` jsonnet | ||
orgs.newOrgRole('<name>') { | ||
<key>: <value> | ||
} | ||
``` | ||
|
||
## Validation rules | ||
|
||
- specifying a non-empty list of `permissions` while `base_role` is set to `none` triggers an error | ||
|
||
## Example usage | ||
|
||
=== "jsonnet" | ||
``` jsonnet | ||
orgs.newOrg('OtterdogTest') { | ||
... | ||
roles+: [ | ||
orgs.newOrgRole('security_team') { | ||
description: "The security team role", | ||
permissions+: [ | ||
"delete_alerts_code_scanning", | ||
"org_review_and_manage_secret_scanning_bypass_requests", | ||
"read_code_scanning", | ||
"resolve_dependabot_alerts", | ||
"resolve_secret_scanning_alerts", | ||
"view_dependabot_alerts", | ||
"view_secret_scanning_alerts", | ||
"write_code_scanning", | ||
], | ||
base_role: "read", | ||
}, | ||
], | ||
... | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.