How to use the authlib.deprecate.deprecate function in Authlib

To help you get started, we’ve selected a few Authlib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lepture / authlib / authlib / oidc / core / grants / implicit.py View on Github external
def get_jwt_config(self):  # pragma: no cover
        """Get the JWT configuration for OpenIDImplicitGrant. The JWT
        configuration will be used to generate ``id_token``. Developers
        MUST implement this method in subclass, e.g.::

            def get_jwt_config(self):
                return {
                    'key': read_private_key_file(key_path),
                    'alg': 'RS512',
                    'iss': 'issuer-identity',
                    'exp': 3600
                }

        :return: dict
        """
        deprecate('Missing "OpenIDImplicitGrant.get_jwt_config"', '1.0', 'fjPsV', 'oi')
        config = self.server.config
        key = config['jwt_key']
        alg = config['jwt_alg']
        iss = config['jwt_iss']
        exp = config['jwt_exp']
        return dict(key=key, alg=alg, iss=iss, exp=exp)
github lepture / authlib / authlib / oidc / core / grants / code.py View on Github external
"""Provide user information for the given scope. Developers
        MUST implement this method in subclass, e.g.::

            from authlib.oidc.core import UserInfo

            def generate_user_info(self, user, scope):
                user_info = UserInfo(sub=user.id, name=user.name)
                if 'email' in scope:
                    user_info['email'] = user.email
                return user_info

        :param user: user instance
        :param scope: scope of the token
        :return: ``authlib.oidc.core.UserInfo`` instance
        """
        deprecate('Missing "OpenIDCode.generate_user_info"', '1.0', 'fjPsV', 'oi')
        scopes = scope_to_list(scope)
        return _generate_user_info(user, scopes)
github lepture / authlib / authlib / client / aiohttp.py View on Github external
from authlib.deprecate import deprecate

deprecate('Please use `authlib.integrations.httpx_client` instead.')
github lepture / authlib / authlib / oidc / core / grants / implicit.py View on Github external
"""Provide user information for the given scope. Developers
        MUST implement this method in subclass, e.g.::

            from authlib.oidc.core import UserInfo

            def generate_user_info(self, user, scope):
                user_info = UserInfo(sub=user.id, name=user.name)
                if 'email' in scope:
                    user_info['email'] = user.email
                return user_info

        :param user: user instance
        :param scope: scope of the token
        :return: ``authlib.oidc.core.UserInfo`` instance
        """
        deprecate('Missing "OpenIDImplicitGrant.generate_user_info"', '1.0', 'fjPsV', 'oi')
        scopes = scope_to_list(scope)
        return _generate_user_info(user, scopes)
github lepture / authlib / authlib / flask / oauth2 / __init__.py View on Github external
# flake8: noqa

from authlib.deprecate import deprecate
from authlib.integrations.flask_oauth2 import (
    AuthorizationServer,
    ResourceProtector,
    current_token,
    client_authenticated,
    token_authenticated,
    token_revoked,
)
from .cache import register_cache_authorization_code

deprecate('Deprecate "authlib.flask.oauth2", USE "authlib.integrations.flask_oauth2" instead.', '1.0', 'Jeclj', 'rn')
github lepture / authlib / authlib / django / client / __init__.py View on Github external
# flake8: noqa

from authlib.deprecate import deprecate
from authlib.integrations.django_client import OAuth, RemoteApp

deprecate('Deprecate "authlib.django.client", USE "authlib.integrations.django_client" instead.', '1.0', 'Jeclj', 'rn')
github lepture / authlib / authlib / client / __init__.py View on Github external
# flake8: noqa

from authlib.deprecate import deprecate
from authlib.integrations.requests_client import (
    OAuth1Session, OAuth1Auth,
    OAuth2Session, OAuth2Auth,
    AssertionSession,
)
from .oauth_client import OAuthClient, OAUTH_CLIENT_PARAMS
from .errors import *

deprecate('Deprecate "authlib.client", USE "authlib.integrations.requests_client" instead.', '1.0', 'Jeclj', 'rn')