# global import
from security import security_util

from typing import List

def _verify(token:str, roles:List[str]=[]):
    try:
        token_info =  security_util.decodeToken(token, roles=roles)
        return token_info
    except Exception as e:
        print("ERROR DURING TOKEN VALIDATION: "+str(e))

        return None

def verifyTokenRegular(token, required_scopes):
    return _verify(token)

def verifyTokenAdmin(token, required_scopes):
    return _verify(token, roles=["a"])