Closed John-F-Wagstaff closed 10 months ago
I tend to create different environments for different projects. This is the way I would generally set up the rest API. As I unserstand it, rest_vv is a dependancy of the API VIJs?
So @John-F-Wagstaff , Auths are added to each endpoint, the dummy auth is in place. In theory, If I merge this, then the rest_VV will run and fall back on the dummy auth. If I remember correctly I will need to update the configuration and give permissions to the auth file?
Would it make sense to merge into development 4 then I can check it on my system and setup the docvker etc before we merge to master? If so, can you re-do the pull request. I will make sure dev4 is up to date too
When you want to use the real authorisation system you will need to edit the config file and add the authorisation's required key file, but in the fallback case none of this is necessary, you only have to do the extra work if when you activate the authorisation system.
As for merging into development 4, I originally intended to do so, but when I checked all the branches where behind master. I assumed that you just needed to update after a merge into master from another branch, but checking the commit list for this it looks like all of these commits it is "behind" are the merge commits on master that pull dev4 into master, so I should have started there instead. I will close this and re-open there.
Edit: Just to clarify the dependency issues, the VIJ and rest_VV modules are completely independent without this patch set, although they have similar code layout and design patterns. The VIJ module depends on the VV_API.DB_Auth module (and is depended on by/can optionally include the partner modules). With this patch the rest_VV code now shares the VV_API.DB_Auth module with the VIJ code, but as an optional dependency, unlike the VIJ code that requires both the database and authorisation code to work at all.
I am generating this pull request for you to have a look at, but although you can push it directly if you want I would appreciate a bit of review, particularly on the pattern of trying to load the auth module and falling back, rather than using a user configurable setting.
This is the simplest method, but maybe not the most user friendly, as it depends passively on the environment in a way that could be unpleasant if you install this alongside another system, like the VIJ code, on the same machine. Do you want me to switch to a configuration based method instead?