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

[BI-1609] Add configuration to enable/disable PUT/POST /variables endpoints in Breedbase #95

Open
timparsons opened this issue Jan 3, 2023 · 5 comments

Comments

@timparsons
Copy link
Member

timparsons commented Jan 3, 2023

Update BreedBase to allow for the POST /variables and PUT /variables endpoints to be enabled or disabled based on a configuration property.

Jira story: https://breedinginsight.atlassian.net/browse/BI-1609

Techspecs

  1. Update sgn.conf to have two new configurations:
    1. brapi_post_variables with a default value of 0
    2. brapi_put_variables with a default value of 0
  2. In lib/SGN/Controller/AJAX/BrAPI.pm update the POST variables method to check the value of the brapi_post_variables
    1. if true, continue with the rest of the method
    2. if false, return a 404
  3. In lib/SGN/Controller/AJAX/BrAPI.pm update the PUT variables method to check the value of the brapi_put_variables
    1. if true, continue with the rest of the method
    2. if false, return a 404
  4. In lib/SGN/Controller/AJAX/BrAPI.pm update the serverInfo method:
    1. include POST /variables in the response if brapi_post_variables is true
    2. include PUT /variables in the response if brapi_put_variables is true
@timparsons timparsons changed the title Add configuration to enable/disable PUT/POST /variables endpoints in Breedbase [BI-1609] Add configuration to enable/disable PUT/POST /variables endpoints in Breedbase Jan 3, 2023
@MFlores2021
Copy link

This is a feature that I was trying to add to the BrAPI spec to all endpoints long ago. @BrapiCoordinatorSelby hope this can go to the serverInfo this time.

@BrapiCoordinatorSelby
Copy link

@MFlores2021 I think we have a misunderstanding here?
It sounds like @timparsons wants to turn whole endpoint on and off. That is the responsibility of the server implementation, not the spec. This would show as the presence or absence of the endpoint in the /serverinfo response.
The feature I think you are referring to is this one plantbreeding/BrAPI#445 ? This is different than what Tim is looking for

@MFlores2021
Copy link

It is related I believe. I meant I was enabling and disabling PUT / POST endpoints in the server side. And reflecting that availability by permissions in the serverInfo endpoint. I think availability shouldn't be binary it should be granted by user and it should be shown in serverInfo.
Using his example, it can be:
brapi_post_variables: all/admin/curator
brapi_put_variables: none
Let me know if it was not clear :(

@BrapiCoordinatorSelby
Copy link

Thanks for the clarification, I see what you mean now! And yes it is related, but I would argue it is not dependent on BrAPI. This functionality could be added to Breedbase before there is a place in the BrAPI spec to represent it, correct?

I just don't want the BrAPI spec to be a blocker for new functionality. I haven't even started looking at the next version of the spec yet, so it will be a long time more before permissions can be officially represented in /serverinfo

@MFlores2021
Copy link

MFlores2021 commented Jan 23, 2023

@BrapiCoordinatorSelby BrAPI spec is not a blocker for sure!. I just made the point to keep in mind, no worries.

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

No branches or pull requests

3 participants