Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 2.5k
Add support for personal_access_token_request webhook event type#2826
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
cf895e5722192cfe0949fFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -774,6 +774,74 @@ type PageBuildEvent struct { | ||
| Installation *Installation `json:"installation,omitempty"` | ||
| } | ||
| // PersonalAccessTokenRequestEvent occurs when there is activity relating to a | ||
| // request for a fine-grained personal access token to access resources that | ||
| // belong to a resource owner that requires approval for token access. | ||
| // The webhook event name is "personal_access_token_request". | ||
| // | ||
| // GitHub API docs: https://docs.github.com/en/webhooks-and-events/webhooks/webhook-events-and-payloads#personal_access_token_request | ||
| type PersonalAccessTokenRequestEvent struct { | ||
| // Action is the action that was performed. Possible values are: | ||
| // "approved", "cancelled", "created" or "denied" | ||
| Action *string `json:"action,omitempty"` | ||
| PersonalAccessTokenRequest *PersonalAccessTokenRequest `json:"personal_access_token_request,omitempty"` | ||
| Org *Organization `json:"organization,omitempty"` | ||
| Sender *User `json:"sender,omitempty"` | ||
| Installation *Installation `json:"installation,omitempty"` | ||
| } | ||
| // PersonalAccessTokenRequest contains the details of a PersonalAccessTokenRequestEvent. | ||
| type PersonalAccessTokenRequest struct { | ||
| // Unique identifier of the request for access via fine-grained personal | ||
| // access token. Used as the pat_request_id parameter in the list and review | ||
| // API calls. | ||
| ID *int64 `json:"id,omitempty"` | ||
| Owner *User `json:"owner,omitempty"` | ||
| // New requested permissions, categorized by type of permission. | ||
| PermissionsAdded *PersonalAccessTokenPermissions `json:"permissions_added,omitempty"` | ||
| // Requested permissions that elevate access for a previously approved | ||
| // request for access, categorized by type of permission. | ||
| PermissionsUpgraded *PersonalAccessTokenPermissions `json:"permissions_upgraded,omitempty"` | ||
| // Permissions requested, categorized by type of permission. | ||
| // This field incorporates permissions_added and permissions_upgraded. | ||
| PermissionsResult *PersonalAccessTokenPermissions `json:"permissions_result,omitempty"` | ||
| // Type of repository selection requested. Possible values are: | ||
| // "none", "all" or "subset" | ||
| RepositorySelection *string `json:"repository_selection,omitempty"` | ||
| // The number of repositories the token is requesting access to. | ||
| // This field is only populated when repository_selection is subset. | ||
| RepositoryCount *int64 `json:"repository_count,omitempty"` | ||
| // An array of repository objects the token is requesting access to. | ||
| // This field is only populated when repository_selection is subset. | ||
| Repositories []*Repository `json:"repositories,omitempty"` | ||
| // Date and time when the request for access was created. | ||
| CreatedAt *Timestamp `json:"created_at,omitempty"` | ||
| // Whether the associated fine-grained personal access token has expired. | ||
| TokenExpired *bool `json:"token_expired,omitempty"` | ||
| // Date and time when the associated fine-grained personal access token expires. | ||
| TokenExpiresAt *Timestamp `json:"token_expires_at,omitempty"` | ||
| // Date and time when the associated fine-grained personal access token was last used for authentication. | ||
| TokenLastUsedAt *Timestamp `json:"token_last_used_at,omitempty"` | ||
| } | ||
| // PersonalAccessTokenPermissions represents the original or newly requested | ||
| // scope of permissions for a fine-grained personal access token within a PersonalAccessTokenRequest. | ||
| type PersonalAccessTokenPermissions struct { | ||
joaopenteado marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| Org map[string]string `json:"organization,omitempty"` | ||
| Repo map[string]string `json:"repository,omitempty"` | ||
| Other map[string]string `json:"other,omitempty"` | ||
| } | ||
| // PingEvent is triggered when a Webhook is added to GitHub. | ||
| // | ||
| // GitHub API docs: https://developer.github.com/webhooks/#ping-event | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.