moving magic secret string uris
This commit is contained in:
parent
c7fe8fada5
commit
1ec929ce98
@ -4,7 +4,7 @@ from music.model.user import User
|
||||
from music.model.config import Config
|
||||
from music.auth.jwt_keys import generate_key
|
||||
from music.api.decorators import no_cache
|
||||
from music.cloud import SPOT_CLIENT_URI, SPOT_SECRET_URI
|
||||
from music.magic_strings import SPOT_CLIENT_URI, SPOT_SECRET_URI
|
||||
|
||||
from urllib.parse import urlencode, urlunparse
|
||||
import datetime
|
||||
@ -78,6 +78,7 @@ def logout():
|
||||
flash('logged out')
|
||||
return redirect(url_for('index'))
|
||||
|
||||
|
||||
@blueprint.route('/token', methods=['POST'])
|
||||
@no_cache
|
||||
def jwt_token():
|
||||
|
@ -1,6 +1,6 @@
|
||||
from datetime import timedelta, datetime, timezone
|
||||
import jwt
|
||||
from music.cloud import JWT_SECRET_URI
|
||||
from music.magic_strings import JWT_SECRET_URI
|
||||
from music.model.user import User
|
||||
|
||||
from google.cloud import secretmanager
|
||||
|
@ -10,12 +10,6 @@ from .tasks import run_user_playlist_task
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
SPOT_CLIENT_URI = "projects/sarsooxyz/secrets/spotify-client/versions/latest"
|
||||
SPOT_SECRET_URI = "projects/sarsooxyz/secrets/spotify-secret/versions/latest"
|
||||
LASTFM_CLIENT_URI = "projects/sarsooxyz/secrets/lastfm-client/versions/latest"
|
||||
JWT_SECRET_URI = "projects/sarsooxyz/secrets/jwt-secret/versions/latest"
|
||||
COOKIE_SECRET_URI = "projects/sarsooxyz/secrets/cookie-secret/versions/latest"
|
||||
|
||||
|
||||
def queue_run_user_playlist(username: str, playlist_name: str):
|
||||
config = Config.collection.get("config/music-tools")
|
||||
|
@ -8,7 +8,7 @@ from spotframework.net.user import NetworkUser
|
||||
from fmframework.net.network import Network as FmNetwork
|
||||
from music.model.user import User
|
||||
|
||||
from music.cloud import SPOT_CLIENT_URI, SPOT_SECRET_URI, LASTFM_CLIENT_URI
|
||||
from music.magic_strings import SPOT_CLIENT_URI, SPOT_SECRET_URI, LASTFM_CLIENT_URI
|
||||
|
||||
from google.cloud import secretmanager
|
||||
|
||||
|
6
music/magic_strings.py
Normal file
6
music/magic_strings.py
Normal file
@ -0,0 +1,6 @@
|
||||
SPOT_CLIENT_URI = "projects/sarsooxyz/secrets/spotify-client/versions/latest"
|
||||
SPOT_SECRET_URI = "projects/sarsooxyz/secrets/spotify-secret/versions/latest"
|
||||
LASTFM_CLIENT_URI = "projects/sarsooxyz/secrets/lastfm-client/versions/latest"
|
||||
JWT_SECRET_URI = "projects/sarsooxyz/secrets/jwt-secret/versions/latest"
|
||||
COOKIE_SECRET_URI = "projects/sarsooxyz/secrets/cookie-secret/versions/latest"
|
||||
APNS_SIGN_URI = "projects/sarsooxyz/secrets/apns-auth-sign-key/versions/1"
|
@ -7,7 +7,7 @@ import os
|
||||
from music.auth import auth_blueprint
|
||||
from music.api import api_blueprint, player_blueprint, fm_blueprint, \
|
||||
spotfm_blueprint, spotify_blueprint, admin_blueprint, tag_blueprint
|
||||
from music.cloud import COOKIE_SECRET_URI
|
||||
from music.magic_strings import COOKIE_SECRET_URI
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
secret_client = secretmanager.SecretManagerServiceClient()
|
||||
|
Loading…
Reference in New Issue
Block a user