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

[BUG] (Auth) Device flow token expiry not set correctly #3288

Closed
2 tasks done
hajapy opened this issue Jan 26, 2023 · 2 comments · Fixed by #4319 · May be fixed by flyteorg/flyteidl#362
Closed
2 tasks done

[BUG] (Auth) Device flow token expiry not set correctly #3288

hajapy opened this issue Jan 26, 2023 · 2 comments · Fixed by #4319 · May be fixed by flyteorg/flyteidl#362
Assignees
Labels
backlogged For internal use. Reserved for contributor team workflow. bug Something isn't working

Comments

@hajapy
Copy link

hajapy commented Jan 26, 2023

Describe the bug

When using the deviceflow with an external auth server, flytectl repeats the device flow each time it is used because it thinks the token is expired. Tracing through the code, I found this is probably the cause. The api response schema, notably has an expires_in not an expiry field. When unmarshalling to an oauth2.Token, it omits the missing expiry and sets the expiry to 0001-01-01T00:00:00Z, which you can verify by looking in your keyring keyring get flytectl 'dns:///<your-endpoint>:flytectl-user'. This causes the future invocations of flytectl to think the token is expired and restart the device flow.

Expected behavior

The stored token should have the expiry date computed from the optional expires_in response from the /token api.

Additional context to reproduce

  1. Configure flytectl to use authType: DeviceFlow and point to an endpoint that has auth enabled
  2. Run flytectl version
  3. Complete device auth flow
  4. Run flytectl version again, notice you need to redo the device auth flow
  5. Inspect contents of keyring and note the expiry date is the zero value of time.Time

Screenshots

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@hajapy hajapy added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Jan 26, 2023
@eapolinario eapolinario removed the untriaged This issues has not yet been looked at by the Maintainers label Jan 27, 2023
@github-actions
Copy link

Hello 👋, This issue has been inactive for over 9 months. To help maintain a clean and focused backlog, we'll be marking this issue as stale and will close the issue if we detect no activity in the next 7 days. Thank you for your contribution and understanding! 🙏

@github-actions github-actions bot added the stale label Oct 25, 2023
@hajapy
Copy link
Author

hajapy commented Oct 25, 2023

This issue persists. The open pr provides a patch that fixes it.

@github-actions github-actions bot removed the stale label Oct 26, 2023
@davidmirror-ops davidmirror-ops added the backlogged For internal use. Reserved for contributor team workflow. label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlogged For internal use. Reserved for contributor team workflow. bug Something isn't working
Projects
None yet
4 participants