gravitino.auth.simple_auth_provider.SimpleAuthProvider¶
- class gravitino.auth.simple_auth_provider.SimpleAuthProvider¶
Bases:
AuthDataProvider
SimpleAuthProvider will use the environment variable GRAVITINO_USER or the user of the system to generate a basic token for every request.
- __init__()¶
Methods
__init__
()close
()Close the resource in the provider.
Acquire the data of token for authentication.
Judge whether AuthDataProvider can provide token data.
- close()¶
Close the resource in the provider.
- get_token_data() bytes ¶
Acquire the data of token for authentication. The client will set the token data as HTTP header Authorization directly. So the return value should ensure token data contain the token header (eg: Bearer, Basic) if necessary.
- Returns:
the token data is used for authentication.
- has_token_data() bool ¶
Judge whether AuthDataProvider can provide token data.
- Returns:
true if the AuthDataProvider can provide token data otherwise false.