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

Test and refactor GetUserInfoFromToken #70

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

kavir1698
Copy link
Contributor

No description provided.

kavir1698 added 3 commits May 16, 2024 10:31
The main changes are:

1. Error handling: Instead of using `log.Fatal` which will terminate the program, the function now returns an error which can be handled by the caller.
2. HTTP request: The token is now sent in the Authorization header instead of the query string, which is a more secure practice.
3. JSON decoding: Instead of reading the entire response body into a byte slice and then decoding it, the function now decodes the JSON directly from the response body.
…he token in url

Because I am not sure the safer method, sending the token in Authorization header, is supported by the server.
datasetUtils/getUserInfoFromToken.go Outdated Show resolved Hide resolved
datasetUtils/getUserInfoFromToken.go Outdated Show resolved Hide resolved
datasetUtils/getUserInfoFromToken.go Outdated Show resolved Hide resolved
datasetUtils/getUserInfoFromToken.go Show resolved Hide resolved
@sbliven
Copy link
Member

sbliven commented May 24, 2024

Looks good other than the compile error.

@minottic
Copy link
Collaborator

@consolethinks if you have any free time, could you check and fix this PR (or close it all together if not relevant to your changes)?

@consolethinks
Copy link
Collaborator

@consolethinks if you have any free time, could you check and fix this PR (or close it all together if not relevant to your changes)?

Sure I'll check on it today or next week

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.

4 participants