Esempio n. 1
0
    def make_token(cls, ephemeral_token):
        """
        Returns a token to be used x number of times to allow a user account to access
        certain resource.
        """
        value = ephemeral_token.key
        if ephemeral_token.scope:
            value += ''.join(ephemeral_token.scope)

        return get_hmac(cls.KEY_SALT + ephemeral_token.salt, value)[::2]
Esempio n. 2
0
 def get_notebook_token(self):
     return get_hmac(conf.get('APP_LABELS_NOTEBOOK'), self.project_uuid)
Esempio n. 3
0
 def get_notebook_token(self):
     return get_hmac(settings.APP_LABELS_NOTEBOOK, self.project_uuid)