uprm-inso4116-2024-2025-s1 / semester-project-multiplayer-dominoes

semester-project-multiplayer-dominoes created by GitHub Classroom
8 stars 0 forks source link

[Lecture Topic Task] Implement factories to the documentation #120

Closed AnthonyMed13 closed 7 minutes ago

AnthonyMed13 commented 2 weeks ago

The team provides at least one example of the application of factories. For example, they might initially expose the directly the constructors of different sub-classes of some super-class. But then they decide that the construction should be hosted in a separate factory class with an API providing entry points behind which complex choices are made as to which concrete object to instantiate.

Temporary Points: Urgency: 4 Difficulty: 1

AnthonyMed13 commented 19 hours ago

We noticed the need for the application of factories in the JWT secret token authorization. The current system only authorized every user with the same role and we needed the ability to deconstruct this and apply multiple sub classes to be able to expand this in the future in the case we need to give special permission such as dashboards or control over the default users to admins or want to add moderators with similar control but less permissions. This would be with subclasses like AdminVerifier and UserVerifier. Now instead of verifying the token in the middleware file. We use the JWT Factory now to select the appropriate verification strategy based on the user's role. This makes the code more flexible and scalable, allowing for easy extensions or modifications to token verification logic without altering the middleware itself, promoting cleaner and more maintainable code.

@AngelCIICMorales Could you check if this is okay for the documentation

AnthonyMed13 commented 2 hours ago

@ebrain-mendoza121 Could you also check if this is okay for the documentation

ebrain-mendoza121 commented 1 hour ago

Example is clearly stated, and well written. Good Job! Remember to later add to official documentation.

AngelCIICMorales commented 7 minutes ago

LGTM