Skip to content

added user's gpg_keys operations for #552#717

Merged
XAMPPRocky merged 1 commit into
XAMPPRocky:mainfrom
dmgorsky:feature/users-552-gpg-keys
Oct 10, 2024
Merged

added user's gpg_keys operations for #552#717
XAMPPRocky merged 1 commit into
XAMPPRocky:mainfrom
dmgorsky:feature/users-552-gpg-keys

Conversation

@dmgorsky
Copy link
Copy Markdown
Collaborator

/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
Copy Markdown
Collaborator 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
Copy Markdown
Owner

Thank you for your PR!

@XAMPPRocky
Copy link
Copy Markdown
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
@github-actions github-actions Bot mentioned this pull request Oct 10, 2024
@dmgorsky
Copy link
Copy Markdown
Collaborator 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
Copy Markdown
Collaborator 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
Copy Markdown
Collaborator 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
Copy Markdown
Owner

How does octokit handle this?

@dmgorsky
Copy link
Copy Markdown
Collaborator 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