materialsproject / mongogrant Goto Github PK
View Code? Open in Web Editor NEWgrant username and password credentials for roles on mongo databases via email verification
License: Other
grant username and password credentials for roles on mongo databases via email verification
License: Other
Today I was helping someone using mongogrant to try to set up a fireworks/atomate pipeline, and we got some feedback that it was a bit convoluted (basically we connected via the normal instructions and then looked at the written config for credentials). I was thinking we might consider developing a rudimentary CLI that connected to a given database and created something like a tasks_db.json or my_launchpad.yaml automatically. Atomate might be a better place for this, though, so it might just be that we add a bit of mongogrant integration into atomate.
Traceback:
Traceback (most recent call last):
File "/Users/jdagdelen/anaconda3/envs/tri/bin/mgrant", line 11, in <module>
sys.exit(cli())
File "/Users/jdagdelen/anaconda3/envs/TRI/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/Users/jdagdelen/anaconda3/envs/TRI/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/Users/jdagdelen/anaconda3/envs/TRI/lib/python3.6/site-packages/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/jdagdelen/anaconda3/envs/TRI/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/Users/jdagdelen/anaconda3/envs/TRI/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/Users/jdagdelen/anaconda3/envs/TRI/lib/python3.6/site-packages/mongogrant/scripts/mgrant.py", line 33, in init
print(rv.json())
File "/Users/jdagdelen/anaconda3/envs/TRI/lib/python3.6/site-packages/requests/models.py", line 888, in json
self.content.decode(encoding), **kwargs
File "/Users/jdagdelen/anaconda3/envs/TRI/lib/python3.6/json/__init__.py", line 354, in loads
return _default_decoder.decode(s)
File "/Users/jdagdelen/anaconda3/envs/TRI/lib/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Users/jdagdelen/anaconda3/envs/TRI/lib/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Pip Freeze:
aniso8601==3.0.2
appdirs==1.4.3
ase==3.16.0
asn1crypto==0.24.0
atomicwrites==1.2.1
attrs==18.2.0
awscli==1.16.73
beautifulsoup4==4.6.1
blessed==1.15.0
boto==2.49.0
boto3==1.7.72
botocore==1.10.72
bz2file==0.98
cached-property==1.4.3
cement==2.8.2
certifi==2018.8.24
cffi==1.11.5
chardet==3.0.4
citrination-client==4.1.2
click==6.7
colorama==0.3.9
cryptography==2.3.1
cssselect==1.0.3
cycler==0.10.0
dash==0.20.0
dash-auth==0.0.11
dash-core-components==0.18.1
dash-html-components==0.8.0
dash-renderer==0.11.3
dash-table-experiments==0.6.0
DAWG==0.7.8
decorator==4.3.0
dockerpty==0.4.1
docopt==0.6.2
docutils==0.14
elasticsearch==6.3.0
elasticsearch-dsl==6.2.1
elsapy==0.4.6
Flask==1.0.2
Flask-Caching==1.4.0
Flask-Compress==1.4.0
flask-marshmallow==0.9.0
Flask-RESTful==0.3.6
Flask-SeaSurf==0.2.2
gensim==3.5.0
globus-nexus-client==0.2.8
globus-sdk==1.5.0
gunicorn==19.9.0
idna==2.7
ipaddress==1.0.22
ipython-genutils==0.2.0
itsdangerous==0.24
Jinja2==2.10
jmespath==0.9.3
jsonschema==2.6.0
jupyter-core==4.4.0
kiwisolver==1.0.1
lxml==4.2.4
MarkupSafe==1.0
marshmallow==2.15.4
matminer==0.4.0
matplotlib==2.2.2
mdf-forge==0.6.3
mdf-toolbox==0.2.6
mkl-fft==1.0.6
mkl-random==1.0.1
mongogrant==0.2.2
monty==1.0.3
more-itertools==4.3.0
mpmath==1.0.0
nbformat==4.4.0
networkx==2.1
nltk==3.3
numpy==1.14.5
palettable==3.1.1
pandas==0.23.4
pdfminer.six==20170720
Pint==0.8.1
pkgconfig==1.3.1
plotly==3.1.0
pluggy==0.7.1
PubChemPy==1.0.4
py==1.6.0
pyasn1==0.4.4
pycparser==2.18
pycryptodome==3.6.4
PyDispatcher==2.0.5
PyJWT==1.6.4
pymatgen==2018.8.7
pymongo==3.7.1
pyparsing==2.2.0
pypif==2.1.0
pytest==3.8.2
python-crfsuite==0.9.6
pytz==2018.5
regex==2018.7.11
requests==2.19.1
retrying==1.3.3
rsa==3.4.2
ruamel.yaml==0.15.51
s3transfer==0.1.13
scikit-learn==0.19.1
scipy==1.1.0
semantic-version==2.5.0
six==1.11.0
sklearn==0.0
smart-open==1.6.0
spglib==1.10.4.7
sympy==1.2
termcolor==1.1.0
texttable==0.9.1
tqdm==4.24.0
traitlets==4.3.2
urllib3==1.22
wcwidth==0.1.7
websocket-client==0.48.0
Werkzeug==0.14.1
It can throw off parsing in client code.
It would be good if Mgrant told you that your token was expired rather than just erroring?
Some nice CLI feature requests
The Atomate starter generates a invalid my_launchpad.yaml file. We need to include the port in that.
Users would be able to set allow/deny rules for an endpoint if a superuser grants them admin rights. Proposed example usage:
mgrant allow "[email protected]" "mongodb03.nersc.gov" "mp_dois" "readWrite" \
--endpoint https://grantmedb.materialsproject.org
mgrant deny "[email protected]" "mongodb.nnsa.energy.gov" "launch_codes" "readWrite" \
--endpoint https://grantmedb.materialsproject.org
@tschaume what do you think?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.