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

feat: add JWT implementation #971

Merged
merged 12 commits into from
Oct 29, 2024
Merged

Conversation

MartinOnufrak
Copy link
Contributor

@MartinOnufrak MartinOnufrak commented Oct 29, 2024

This pull request introduces the getJWTToken method to the internet module.
Changes
• New Method: getJWTToken
• Purpose: Generates a JWT token.
• Parameters:
• std::optional<std::map<std::string, std::string>> header: The header to be included in the JWT.
• std::optional<std::map<std::string, std::string>> payload: The payload to be included in the JWT.
• std::optionalstd::string refDate: The refference date to be included in the JWT.
• Returns: A std::string representing the generated JWT token.

The implementation using few other methods:
• getJWTAlgorithm
• toJSON
• toBase64UrlEncode

Copy link
Owner

@cieslarmichal cieslarmichal left a comment

Choose a reason for hiding this comment

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

Good job, couple minor comments, and please merge latest changes into your branch.
It would be nice to have more tests here

src/modules/internet.cpp Outdated Show resolved Hide resolved
src/modules/internet.cpp Outdated Show resolved Hide resolved
include/faker-cxx/internet.h Outdated Show resolved Hide resolved
include/faker-cxx/internet.h Outdated Show resolved Hide resolved
include/faker-cxx/internet.h Outdated Show resolved Hide resolved
include/faker-cxx/internet.h Outdated Show resolved Hide resolved
src/modules/internet.cpp Outdated Show resolved Hide resolved
src/modules/internet.cpp Outdated Show resolved Hide resolved
tests/modules/internet_test.cpp Show resolved Hide resolved
@MartinOnufrak
Copy link
Contributor Author

All the requirements should be fullfilled

Copy link
Owner

@cieslarmichal cieslarmichal left a comment

Choose a reason for hiding this comment

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

Please merge latest changes from main branch and move utility functions from include file

include/faker-cxx/internet.h Outdated Show resolved Hide resolved
@cieslarmichal cieslarmichal linked an issue Oct 29, 2024 that may be closed by this pull request
Copy link
Owner

@cieslarmichal cieslarmichal left a comment

Choose a reason for hiding this comment

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

Your changes include some submodule related stuff, try to git aubmodule update to get latest we have in repo

@cieslarmichal
Copy link
Owner

Build fails, please fix it

@MartinOnufrak
Copy link
Contributor Author

MartinOnufrak commented Oct 29, 2024

sorry for problems ... i had merge conflict there

src/modules/internet.cpp Outdated Show resolved Hide resolved
@cieslarmichal cieslarmichal merged commit babc1fe into cieslarmichal:main Oct 29, 2024
12 checks passed
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.

add jwt function to Internet module
2 participants