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

[WIP] v2.x - Rework SP request UUID generation to remove mutable constant #735

Open
wants to merge 2 commits into
base: v2.x
Choose a base branch
from

Conversation

johnnyshields
Copy link
Collaborator

@johnnyshields johnnyshields commented Jan 11, 2025

This PR reworks the way SP request UUID generation is handled.

  • Replace the mutable RubySaml::Utils::UUID_PREFIX constant and set_prefix method with Settings.sp_uuid_prefix
    • (Mutable constants are not thread-safe, violate principle of least surprise, etc.)
  • Make Authnrequest, etc. uuid attribute to be immutable.
  • Initialize Authnrequest, etc. uuid attribute when create is called, based on Settings.sp_uuid_prefix, not when instantiating the Ruby object.
image

- Replace the mutable RubySaml::Utils::UUID_PREFIX constant with `Settings.sp_uuid_prefix`
- Make Authnrequest, etc. `uuid` attribute to be immutable.
- Initialize Authnrequest, etc. `uuid` attribute when `create` is called, based on `Settings.sp_uuid_prefix`, not when instantiating the Ruby object.
@johnnyshields johnnyshields changed the title v2.x - Reworks SP request UUID generation to remove mutable constant. [WIP] v2.x - Reworks SP request UUID generation to remove mutable constant. Jan 11, 2025
@johnnyshields johnnyshields changed the title [WIP] v2.x - Reworks SP request UUID generation to remove mutable constant. [WIP] v2.x - Rework SP request UUID generation to remove mutable constant Jan 11, 2025
@johnnyshields
Copy link
Collaborator Author

@pitbulk would like to get your feedback on this. I am OK to keep the Authnrequest.uuid = mutator method if there's really a use case for it.

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