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(token): token endpoint is now configurable #421

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

Divan009
Copy link
Contributor

@Divan009 Divan009 commented Oct 1, 2024

This pull request introduces the _parse_issuer function, enhancing the validation and normalization of issuer URLs for OAuth token requests. It ensures URLs adhere to standards by verifying schemes and appending a default path if needed.

Description

This pull request introduces a new function, _parse_issuer, to the authentication system, specifically designed to enhance the validation and normalization of issuer URLs used in OAuth token requests.

This function systematically checks and corrects the structure of the issuer URL, ensuring it adheres to expected standards, such as including a valid scheme (http or https) and appending a default endpoint path if none is provided.

Additionally, comprehensive tests have been added to validate the functionality of this new method against various edge cases and common URL formatting errors.

Changes

  • Added _parse_issuer function to enhance issuer URL validation in Credentials.
  • Implemented unit tests for _parse_issuer to ensure robust handling of a variety of URL inputs.

References

This PR closes issue #238 for Python SDK

Review Checklist

  • I have clicked on "allow edits by maintainers".
  • I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
  • The correct base branch is being used, if not main
  • I have added tests to validate that the change in functionality is working as expected

@Divan009 Divan009 requested a review from a team as a code owner October 1, 2024 17:59
@rhamzeh rhamzeh changed the title feat/(token): token endpoint is now configurable feat(token): token endpoint is now configurable Oct 18, 2024
@rhamzeh
Copy link
Member

rhamzeh commented Oct 18, 2024

Thank you @Divan009!

@rhamzeh
Copy link
Member

rhamzeh commented Oct 18, 2024

We'll merge this - may I ask you to raise a companion PR to the Python SDK itself too?

@rhamzeh rhamzeh added this pull request to the merge queue Oct 18, 2024
Merged via the queue into openfga:main with commit a023043 Oct 18, 2024
10 checks passed
@Divan009
Copy link
Contributor Author

Divan009 commented Oct 19, 2024

@rhamzeh

No problem! Happy to contribute 😄

I had raised the PR initially to Python SDK but noticed they might not be accepting PRs at the moment, so I closed it. I'll go ahead and reopen it.

@ewanharris ewanharris mentioned this pull request Oct 25, 2024
4 tasks
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.

2 participants