Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Refactor: Rename getToken to authorize #334

Open
andrewxhill opened this issue Jun 22, 2020 · 2 comments
Open

Refactor: Rename getToken to authorize #334

andrewxhill opened this issue Jun 22, 2020 · 2 comments
Assignees

Comments

@andrewxhill
Copy link
Member

There is a bit of confusion about the point of getToken. It appears on its face to be something more like an authenticate api. However, a user's token doesn't need to change, so you only technically have to get a user their token one single time in their lifetime in the app. So, what's a good way to clarify this api?

Maybe getToken shouldn't live on the the Database/Client classes? It might be nice to have a User class for something like getToken and then more explicitly on Client just a setToken... That's just one idea though.

@andrewxhill
Copy link
Member Author

I've settled on these terms

authenticate is what the developer does with the hub api. they authenticate with their api key/secret

authorize is what the developer does with a user identity and the api. they authorize a user identity to use their hub api endpoint for a period of time.

so i think getToken should just become client.authorize(identity)

@carsonfarmer carsonfarmer changed the title Rename getToken to authenticate or similiar Refactor: Rename getToken to authenticate or similar Sep 25, 2020
@carsonfarmer carsonfarmer changed the title Refactor: Rename getToken to authenticate or similar Refactor: Rename getToken to authorize Sep 25, 2020
@carsonfarmer
Copy link
Member

This is being done as part of The Great Refactor (#414) work.

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

No branches or pull requests

2 participants