sdk-generator icon indicating copy to clipboard operation
sdk-generator copied to clipboard

feat/(token): token endpoint is now configurable

Open Divan009 opened this issue 4 months ago • 0 comments

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

  • [x] I have clicked on "allow edits by maintainers".
  • [x] 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]
  • [x] The correct base branch is being used, if not main
  • [x] I have added tests to validate that the change in functionality is working as expected

Divan009 avatar Oct 01 '24 17:10 Divan009