Skip to content

feat: Add ListFineGrainedPersonalAccessTokenRequests for org#4022

Open
AbhishekAg wants to merge 2 commits intogoogle:masterfrom
AbhishekAg:abhi/fine_grained_PAT_requests
Open

feat: Add ListFineGrainedPersonalAccessTokenRequests for org#4022
AbhishekAg wants to merge 2 commits intogoogle:masterfrom
AbhishekAg:abhi/fine_grained_PAT_requests

Conversation

@AbhishekAg
Copy link
Contributor

@AbhishekAg AbhishekAg commented Feb 18, 2026

Implement support for listing requests to access organization resources via fine-grained personal access tokens (GET /orgs/{org}/personal-access-token-requests).

  • Add FineGrainedPersonalAccessTokenRequests struct for request details
    (id, reason, owner, repository selection, permissions, timestamps, token info)
  • Add ListFineGrainedPATRequestOptions with TokenID filter and embedded
    ListFineGrainedPATOptions (sort, direction, owner, repository, permission, last_used_before/after, pagination)
  • Add OrganizationsService.ListFineGrainedPersonalAccessTokenRequests
  • Add addListFineGrainedPATRequestOptions helper for owner[] and token_id[] query parameters

API docs: https://docs.github.com/en/rest/orgs/personal-access-tokens#list-requests-to-access-organization-resources-with-fine-grained-personal-access-tokens

Fixes: #4021

…sting

Signed-off-by: abhishek <abhishek@exaforce.com>
@gmlewis gmlewis changed the title Add ListFineGrainedPersonalAccessTokenRequests for org PAT request listing feat: Add ListFineGrainedPersonalAccessTokenRequests for org PAT request listing Feb 18, 2026
@gmlewis gmlewis changed the title feat: Add ListFineGrainedPersonalAccessTokenRequests for org PAT request listing feat: Add ListFineGrainedPersonalAccessTokenRequests for org Feb 18, 2026
@gmlewis gmlewis added the NeedsReview PR is awaiting a review before merging. label Feb 18, 2026
@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.07%. Comparing base (a2d86b0) to head (f8b7572).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4022      +/-   ##
==========================================
+ Coverage   94.04%   94.07%   +0.02%     
==========================================
  Files         207      207              
  Lines       19206    19262      +56     
==========================================
+ Hits        18063    18121      +58     
+ Misses        940      939       -1     
+ Partials      203      202       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

}

// FineGrainedPersonalAccessTokenRequests represents the details of a request to access organization resources via a fine-grained personal access token.
type FineGrainedPersonalAccessTokenRequests struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why Requests and not Request?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API is personal-access-token-requests hence I used requests instead of request

// FineGrainedPersonalAccessTokenRequests represents the details of a request to access organization resources via a fine-grained personal access token.
type FineGrainedPersonalAccessTokenRequests struct {
// Unique identifier of the request for access via fine-grained personal access token.
ID *int64 `json:"id"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not ID int64? Is there a reason you used * for every field in the struct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can certainly update my codepiece to not to use pointer in ID and TokenID. The change in existing API "PersonalAccessToken" may break the consumer of this.

Signed-off-by: abhishek <abhishek@exaforce.com>
@AbhishekAg
Copy link
Contributor Author

@gmlewis Can you please re-run the pipeline? linter error is due to 503

validating openapi_operations.yaml
unexpected status code: 503 Service Unavailable
failed validating openapi_operations.yaml
validating generated files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

NeedsReview PR is awaiting a review before merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement REST API Endpoint for listing fine grained personal access token requests

3 participants

Comments