strategies
Authentication strategy implementations for Core.
class AuthStrategy(iam_url: str, storage: Optional[datalayer_core.authn.storage.TokenStorage] = None)
Base authentication strategy interface.
__init__(iam_url: str, storage: Optional[datalayer_core.authn.storage.TokenStorage] = None)
Initialize strategy.
Args: iam_url: IAM service URL storage: Optional token storage backend
authenticate(**kwargs: Any) -> Tuple[Dict[str, Any], str]
Authenticate and return (user, token) tuple.
Returns
-
tuple of (dict, str)
Tuple of (user_dict, token_string).
Raises
-
Exception
If authentication fails
can_handle(**kwargs: Any) -> bool
Check if this strategy can handle the given options.
Returns
-
bool
True if this strategy can authenticate with given options.
class TokenAuthStrategy(iam_url: str, storage: Optional[datalayer_core.authn.storage.TokenStorage] = None)
Token-based authentication strategy.
can_handle(**kwargs: Any) -> bool
Check if token is provided.
authenticate(**kwargs: Any) -> Tuple[Dict[str, Any], str]
Authenticate using existing token.
class CredentialsAuthStrategy(iam_url: str, storage: Optional[datalayer_core.authn.storage.TokenStorage] = None)
Credentials-based authentication strategy.
can_handle(**kwargs: Any) -> bool
Check if handle and password are provided.
authenticate(**kwargs: Any) -> Tuple[Dict[str, Any], str]
Authenticate using handle and password.
class StorageAuthStrategy(iam_url: str, storage: Optional[datalayer_core.authn.storage.TokenStorage] = None)
Storage-based authentication strategy.
can_handle(**kwargs: Any) -> bool
Check if storage has a token.
authenticate(**kwargs: Any) -> Tuple[Dict[str, Any], str]
Authenticate using token from storage.
class BrowserAuthStrategy(iam_url: str, storage: Optional[datalayer_core.authn.storage.TokenStorage] = None)
Browser OAuth authentication strategy.
can_handle(**kwargs: Any) -> bool
Check if browser auth is requested.
authenticate(**kwargs: Any) -> Tuple[Dict[str, Any], str]
Authenticate using browser OAuth flow.