Skip to content
This repository was archived by the owner on Nov 18, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ovos_local_backend/backend/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from ovos_local_backend.backend import API_VERSION
from ovos_local_backend.backend.decorators import noindex, requires_auth
from ovos_local_backend.database.oauth import OAuthTokenDatabase, OAuthApplicationDatabase
from ovos_backend_client.database import OAuthTokenDatabase, OAuthApplicationDatabase
from ovos_local_backend.utils import nice_json

os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1'
Expand Down
35 changes: 2 additions & 33 deletions ovos_local_backend/database/oauth.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,2 @@
from json_database import JsonStorageXDG


class OAuthTokenDatabase(JsonStorageXDG):
def __init__(self):
super().__init__("ovos_oauth")

def add_token(self, oauth_service, token_data):
self[oauth_service] = token_data

def total_tokens(self):
return len(self)


class OAuthApplicationDatabase(JsonStorageXDG):
def __init__(self):
super().__init__("ovos_oauth_apps")

def add_application(self, oauth_service,
client_id, client_secret,
auth_endpoint, token_endpoint, refresh_endpoint,
callback_endpoint, scope):
self[oauth_service] = {"oauth_service": oauth_service,
"client_id": client_id,
"client_secret": client_secret,
"auth_endpoint": auth_endpoint,
"token_endpoint": token_endpoint,
"refresh_endpoint": refresh_endpoint,
"callback_endpoint": callback_endpoint,
"scope": scope}

def total_apps(self):
return len(self)
# backwards compat import
from ovos_backend_client.database import OAuthTokenDatabase, OAuthApplicationDatabase
2 changes: 1 addition & 1 deletion requirements/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ ovos-stt-plugin-server
geocoder
timezonefinder
requests_cache
ovos_backend_client~=0.0, >=0.0.5a3
ovos-backend-client~=0.0, >=0.0.6a10
oauthlib~=3.0