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

Plan how to add testing sessions functionality to existing code #424

Open
MikhailDeriabin opened this issue Feb 8, 2025 · 1 comment
Open
Assignees
Labels
docs Improvements or additions to documentation
Milestone

Comments

@MikhailDeriabin
Copy link
Member

MikhailDeriabin commented Feb 8, 2025

There should be created a plan how to integrate the requirements of the testing session to the existing API.

All the functionality of the group admin can be found here:

On stage 2

On stage 3

The main problem here is, that the box should limit access to its resources from outsiders. For example:

/clan GET is returning all clans existing => the boxes are not isolated from each other, since this query should only return 2 clans created for the current box.

The same problem is with /player, profile, stock etc., almost with everything.

Obvious solution could be to add some if-else statements:

if( environment === 'TESTING_SESSION' ){
  // return clans only for this session
} else {
  // work as usual 
}

This solution is straight forward, but this means that almost every controller method should be changed to same manner, and it is not the most optimal one, especially if there will be a need to remove all of them from code after couple of months or so.

It is possible that the if-else is the only one.

Solution, if any, can be placed to docs folder (diagrams or .md files)

@MikhailDeriabin MikhailDeriabin added the docs Improvements or additions to documentation label Feb 8, 2025
@MikhailDeriabin MikhailDeriabin added this to the Testing group milestone Feb 8, 2025
@MikhailDeriabin
Copy link
Member Author

Change Services that are injected to controllers, so based on the .env

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
Status: Backlog
Development

No branches or pull requests

2 participants