Skip to content
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

added user's gpg_keys operations for #552 #717

Merged
merged 1 commit into from
Oct 10, 2024

Conversation

dmgorsky
Copy link
Contributor

/user/gpg_keys
/user/gpg_keys/{gpg_key_id}
#552

@dmgorsky dmgorsky marked this pull request as draft October 10, 2024 13:04
@dmgorsky
Copy link
Contributor Author

idk what to do with
https://docs.github.com/en/rest/users/gpg-keys?apiVersion=2022-11-28#list-gpg-keys-for-a-user
(/users/{username}/gpg_keys)
looks the same as users("username").gpg_keys().list()

@dmgorsky dmgorsky marked this pull request as ready for review October 10, 2024 16:45
@XAMPPRocky
Copy link
Owner

Thank you for your PR!

@XAMPPRocky
Copy link
Owner

I would call it list_for_user that accepts a username parameter. It's different because it lets anyone access anyone else's GPG keys.

@XAMPPRocky XAMPPRocky merged commit b6c30d1 into XAMPPRocky:main Oct 10, 2024
11 checks passed
@github-actions github-actions bot mentioned this pull request Oct 10, 2024
@dmgorsky
Copy link
Contributor Author

I would call it list_for_user that accepts a username parameter. It's different because it lets anyone access anyone else's GPG keys.

Good, I'll follow this style also for:

/users/{username}/following
/users/{username}/gpg_keys
/users/{username}/followers
/users/{username}/keys
/users/{username}/following/{target_user}
/users/{username}/hovercard
/users/{username}/ssh_signing_keys
/users/{username}/social_accounts

@dmgorsky
Copy link
Contributor Author

I would call it list_for_user that accepts a username parameter. It's different because it lets anyone access anyone else's GPG keys.

Good, I'll follow this style also for:

/users/{username}/following /users/{username}/gpg_keys /users/{username}/followers /users/{username}/keys /users/{username}/following/{target_user} /users/{username}/hovercard /users/{username}/ssh_signing_keys /users/{username}/social_accounts

@XAMPPRocky
BTW, users and user_by_id functions (in lib.rs) actually create the same UserHandler, so perhaps for such 'open data' w/o auth - we could create some top-level builder?
e.g, instead of
users("userid").gpg_keys().list_for_user("another")
create
anyone().list_gpg_keys_for_user("userid"),
anyone().list_followers_for_user("userid")
(or unauth() or something)
and so on?

@dmgorsky dmgorsky deleted the feature/users-552-gpg-keys branch October 11, 2024 08:45
@dmgorsky
Copy link
Contributor Author

@XAMPPRocky BTW, users and user_by_id functions (in lib.rs) actually create the same UserHandler, so perhaps for such 'open data' w/o auth - we could create some top-level builder? e.g, instead of users("userid").gpg_keys().list_for_user("another") create anyone().list_gpg_keys_for_user("userid"), anyone().list_followers_for_user("userid") (or unauth() or something) and so on?

I would go with public().

@XAMPPRocky
Copy link
Owner

How does octokit handle this?

@dmgorsky
Copy link
Contributor Author

How does octokit handle this?

        listGpgKeysForAuthenticatedUser: {
            parameters: RequestParameters & Endpoints["GET /user/gpg_keys"]["parameters"];
            response: Endpoints["GET /user/gpg_keys"]["response"];
        };
        listGpgKeysForUser: {
            parameters: RequestParameters & Endpoints["GET /users/{username}/gpg_keys"]["parameters"];
            response: Endpoints["GET /users/{username}/gpg_keys"]["response"];
        };

so ForAuthenticatedUser or ForUser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants