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

Modify auth flow for transkribus to include refresh token #68

Merged
merged 18 commits into from
Feb 28, 2023

Conversation

Parthiv-M
Copy link
Collaborator

Modify the authentication flow of the Transkribus engine to use refresh tokens in addition to access tokens

Bug: T330052

@Parthiv-M Parthiv-M added the WIP label Feb 21, 2023
tests/OcrTestCase.php Outdated Show resolved Hide resolved
kolakachi and others added 3 commits February 23, 2023 10:18
Removed accessToken and refreshToken arguments from TranskribusClient constructor
Added env variables to phpunit.xml.dist
Copy link
Member

@samwilson samwilson left a comment

Choose a reason for hiding this comment

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

Looks great, works in my tests. Just a few errant variables that are no longer required, but otherwise good to go I think.

tests/Controller/OcrControllerTest.php Outdated Show resolved Hide resolved
config/services.yaml Outdated Show resolved Hide resolved
src/Command/TranskribusAuthCommand.php Outdated Show resolved Hide resolved
src/Command/TranskribusAuthCommand.php Outdated Show resolved Hide resolved
tests/OcrTestCase.php Outdated Show resolved Hide resolved
src/Engine/TranskribusClient.php Outdated Show resolved Hide resolved
Intuition $intuition,
string $projectDir,
HttpClientInterface $httpClient
) {
parent::__construct($intuition, $projectDir, $httpClient);

$this->transkribusClient = $transkribusClient;
$this->transkribusClient->setTokens($accessToken, $refreshToken);
Copy link
Member

Choose a reason for hiding this comment

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

The tokens are only injected here in order to be passed through to the client — would it be better to inject them into the client instead?

Moved token injection from TranskribusEngine to TranskribusClient
Updated OcrControllerTest and services.yaml
@samwilson samwilson merged commit dbc2d6f into main Feb 28, 2023
@samwilson samwilson deleted the fix-auth-flow branch February 28, 2023 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants