mirror of https://github.com/krateng/maloja.git
Implemented web interface for API key management, close GH-24
This commit is contained in:
parent
115be57651
commit
6aee8c7a48
|
@ -1,5 +1,5 @@
|
|||
from ..database import *
|
||||
from ..globalconf import malojaconfig
|
||||
from ..globalconf import malojaconfig, apikeystore
|
||||
from ..__pkginfo__ import version
|
||||
from ..malojauri import uri_to_internal
|
||||
from .. import utilities
|
||||
|
@ -331,5 +331,9 @@ def newrule(**keys):
|
|||
@api.post("settings")
|
||||
@authenticated_api
|
||||
def set_settings(**keys):
|
||||
from .. import globalconf
|
||||
globalconf.malojaconfig.update(keys)
|
||||
malojaconfig.update(keys)
|
||||
|
||||
@api.post("apikeys")
|
||||
@authenticated_api
|
||||
def set_settings(**keys):
|
||||
apikeystore.update(keys)
|
||||
|
|
|
@ -313,7 +313,7 @@ config(
|
|||
|
||||
|
||||
### symmetric keys are fine for now since we hopefully use HTTPS
|
||||
apikeystore = KeyStore(file=data_dir['clients']("apikeys.yml"),save_endpoint="/apis/mlj_1/api_keys")
|
||||
apikeystore = KeyStore(file=data_dir['clients']("apikeys.yml"),save_endpoint="/apis/mlj_1/apikeys")
|
||||
|
||||
oldfile = pthj(dir_settings['config'],"clients","authenticated_machines.tsv")
|
||||
if os.path.exists(oldfile):
|
||||
|
|
|
@ -4,5 +4,7 @@
|
|||
|
||||
|
||||
{% block maincontent %}
|
||||
Here you can add and remove API keys used by your scrobblers. It is recommended to use
|
||||
a different key for each scrobbler.<br/><br/>
|
||||
{{ apikeys.html() }}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in New Issue