Skip to content

Allow JWT from string - #1021

Merged
bitwiseman merged 1 commit into
hub4j:masterfrom
bitwiseman:jwt-string
Jan 15, 2021
Merged

bitwiseman merged 1 commit into
hub4j:masterfrom
bitwiseman:jwt-string

Conversation

@bitwiseman

Copy link
Copy Markdown
Member

Description

  • Push your changes to a branch other than master. Create your PR from that branch.
  • Add JavaDocs and other comments
  • Write tests that run and pass in CI. See CONTRIBUTING.md for details on how to capture snapshot data.
  • Run mvn clean compile locally. This may reformat your code, commit those changes.
  • Run mvn -D enable-ci clean install site locally. If this command doesn't succeed, your change will not pass CI.

When creating a PR:

  • Fill in the "Description" above.
  • Enable "Allow edits from maintainers".

@bitwiseman
bitwiseman requested a review from timja January 14, 2021 22:27

public JWTTokenProvider(String applicationId, File keyFile) throws GeneralSecurityException, IOException {
this(applicationId, loadPrivateKey(keyFile.toPath()));
this(applicationId, keyFile.toPath());

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Refactoring to get a single code path through all the constructors.

new File(this.getClass().getResource(PRIVATE_KEY_FILE_APP_1).getFile()));
JWT_PROVIDER_2 = new JWTTokenProvider(TEST_APP_ID_2,
new File(this.getClass().getResource(PRIVATE_KEY_FILE_APP_2).getFile()));
new File(this.getClass().getResource(PRIVATE_KEY_FILE_APP_2).getFile()).toPath());

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Modified tests to make sure all constructors are tested.

@bitwiseman bitwiseman closed this Jan 15, 2021
@bitwiseman bitwiseman reopened this Jan 15, 2021
@bitwiseman
bitwiseman merged commit 80124e3 into hub4j:master Jan 15, 2021
@bitwiseman
bitwiseman deleted the jwt-string branch January 15, 2021 04:09
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.

1 participant