NotebookTokenCache

class gafaelfawr.cache.NotebookTokenCache

Bases: TokenCache

Cache for notebook tokens.

Methods Summary

get(token_data)

Retrieve a notebook token from the cache.

store(token_data, token)

Store a notebook token in the cache.

Methods Documentation

get(token_data)

Retrieve a notebook token from the cache.

Parameters:

token_data (TokenData) – The authentication data for the parent token.

Returns:

The cached token or None if there is no matching token in the cache.

Return type:

Token or None

Notes

The token is not checked for validity or expiration. This must be done by the caller, while holding the lock, and the token replaced in the cache if it is not valid.

store(token_data, token)

Store a notebook token in the cache.

Should only be called while holding the lock.

Parameters:
  • token_data (TokenData) – The authentication data for the parent token.

  • token (Token) – The token to cache.

Return type:

None