Closed lboeman closed 5 years ago
I think this is in a decent place. Code coverage is missing spots where I've reraised an error after catching a specific mysql errno. The only issue I have with it's current iteration is that add_user_to_org checks if the user is in the Unaffiliated organization before allowing them to be added, and as a result the error returned when a user does not exist is 'Cannot add affiliated user to organization'. I think this is ready for review, but perhaps after being rebased upon #155
Added username and password as options to this as per comments from @alorenzo175 in the openshift deployment repo. Can be passed as using --password <password>
or the user will be prompted.
Oh, I need to set FLASK_APP=sfa_api.admincli
for this to work? Didn't read that and I'll forget that everytime. Can we add the admin group as another command under sfa-api
using https://flask.palletsprojects.com/en/1.1.x/cli/#custom-scripts?
Adds a basic admin cli using the built in flask cli so we can use the storage interface. Still somewhat rough, needs some refactoring, ideally a way to repeat command arguments/options. Will require #155, needs to be rebased after that's merged. Running requires installing the API and setting the
FLASK_APP
environment variable tosfa_api.admincli
and theMYSQL_*
variables appropriately. Then the cli can be run withflask admin <command>
. Testing would require setting theSFA_CLI_CONFIG
env var toAdminTestConfig
, or setting the environment variables individually. closes #150