Skip to content
Snippets Groups Projects
Commit 4053d4e2 authored by Christian Witzler's avatar Christian Witzler
Browse files

add token function

See merge request !59
parents 6dade14d 0ca4599d
No related branches found
No related tags found
1 merge request!59add token function
Pipeline #130294 passed
...@@ -3,7 +3,7 @@ _specifier_ = {'alpha': 'a', 'beta': 'b', 'candidate': 'rc', 'final': ''} ...@@ -3,7 +3,7 @@ _specifier_ = {'alpha': 'a', 'beta': 'b', 'candidate': 'rc', 'final': ''}
# Module version # Module version
version_info = (0, 10, 0, 'candidate', 4) version_info = (0, 10, 0, 'candidate', 5)
version_end = '' if version_info[3] == 'final' else _specifier_[version_info[3]]+str(version_info[4]) version_end = '' if version_info[3] == 'final' else _specifier_[version_info[3]]+str(version_info[4])
__version__ = f'{version_info[0]}.{version_info[1]}.{version_info[2]}{version_end}' __version__ = f'{version_info[0]}.{version_info[1]}.{version_info[2]}{version_end}'
......
...@@ -20,6 +20,11 @@ def parseUserToken(text: str) -> Tuple[str,int]: ...@@ -20,6 +20,11 @@ def parseUserToken(text: str) -> Tuple[str,int]:
tokens: Dict[str,int]= {} tokens: Dict[str,int]= {}
def addToken(token:str, scope:int) -> None:
tokens[token] = scope
def registerTokens() -> None: def registerTokens() -> None:
for user_token in settings.USER_DEFINED_TOKEN: for user_token in settings.USER_DEFINED_TOKEN:
(token, scope) = parseUserToken(user_token) (token, scope) = parseUserToken(user_token)
......
...@@ -75,7 +75,7 @@ def registerStatusLinks(version: int) -> Dict[str, Union[bool, str, List[Dict[st ...@@ -75,7 +75,7 @@ def registerStatusLinks(version: int) -> Dict[str, Union[bool, str, List[Dict[st
def registerConfigLinks(version: int) -> Dict[str, Union[bool, str, List[Dict[str, str]]]]: def registerConfigLinks(version: int) -> Dict[str, Union[bool, str, List[Dict[str, str]]]]:
types : List[str] = ['Nodename'] types : List[str] = ['Nodename']
descriptions : List[str] = ['retrieve the name of a node, to enable better debugging'] descriptions : List[str] = ['retrieve the name of a node, to enable better debugging']
if pluginInformation.pluginIsWorking("jumonc_CPUPlugin") is True: if pluginInformation.pluginIsWorking("jumonc_JOBPlugin") is True:
for i, typeStr in enumerate(types): for i, typeStr in enumerate(types):
config_links.append({ config_links.append({
"link": "/v" + str(version) + job_path + "/config/" + typeStr, "link": "/v" + str(version) + job_path + "/config/" + typeStr,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment