Skip to content
Snippets Groups Projects
Commit 7f23845d authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Merge branch '513-broken-get_-_scopes-api-for-oauth' into 'master'

Resolve "Broken get_*_scopes API for OAuth"

Closes #513

See merge request !721
parents eabf097d 09397b9f
No related branches found
No related tags found
1 merge request!721Resolve "Broken get_*_scopes API for OAuth"
Pipeline #34165 passed
Pipeline: AlekSIS

#34170

    ......@@ -18,6 +18,7 @@ Fixed
    ~~~~~
    * Show link to imprint in footer
    * Fix API for adding OAuth scopes in AppConfigs
    Removed
    ~~~~~~~
    ......
    ......@@ -138,7 +138,8 @@ class CoreConfig(AppConfig):
    # Save the associated person to pick up defaults
    user.person.save()
    def get_all_scopes(self) -> dict[str, str]:
    @classmethod
    def get_all_scopes(cls) -> dict[str, str]:
    scopes = {
    "read": "Read anything the resource owner can read",
    "write": "Write anything the resource owner can write",
    ......
    ......@@ -217,22 +217,25 @@ class AppConfig(django.apps.AppConfig):
    """
    pass
    def get_all_scopes(self) -> dict[str, str]:
    @classmethod
    def get_all_scopes(cls) -> dict[str, str]:
    """Return all OAuth scopes and their descriptions for this app."""
    return {}
    @classmethod
    def get_available_scopes(
    self,
    cls,
    application: Optional["AbstractApplication"] = None,
    request: Optional[HttpRequest] = None,
    *args,
    **kwargs,
    ) -> list[str]:
    """Return a list of all OAuth scopes available to the request and application."""
    return list(self.get_all_scopes().keys())
    return list(cls.get_all_scopes().keys())
    @classmethod
    def get_default_scopes(
    self,
    cls,
    application: Optional["AbstractApplication"] = None,
    request: Optional[HttpRequest] = None,
    *args,
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment