Migration to last.fm, removed old spotify api client. FOSRestBundle API serving data driven front end (JWT).
This commit is contained in:
1 parent
391ecf1732
commit
56dea097d6
51 files changed
+1749
-844
No files matched your search
@@ -2,6 +2,8 @@
|
||||
|
||||
return [
|
||||
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
|
||||
FOS\RestBundle\FOSRestBundle::class => ['all' => true],
|
||||
Lexik\Bundle\JWTAuthenticationBundle\LexikJWTAuthenticationBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
|
||||
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true],
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
fos_rest:
|
||||
format_listener:
|
||||
rules:
|
||||
- { path: ^/api, prefer_extension: false, fallback_format: json, priorities: [json] }
|
||||
- { path: ^/, prefer_extension: false, fallback_format: html, priorities: [html, '*/*'] }
|
||||
body_listener: true
|
||||
view:
|
||||
view_response_listener: force
|
||||
formats:
|
||||
json: true
|
||||
@@ -0,0 +1,5 @@
|
||||
lexik_jwt_authentication:
|
||||
secret_key: '%kernel.project_dir%/config/jwt/private.pem'
|
||||
public_key: '%kernel.project_dir%/config/jwt/public.pem'
|
||||
pass_phrase: '%env(JWT_PASSPHRASE)%'
|
||||
token_ttl: 3600
|
||||
@@ -15,6 +15,21 @@ security:
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
api_login:
|
||||
pattern: ^/api/v1/auth/login$
|
||||
stateless: true
|
||||
provider: app_user_provider
|
||||
json_login:
|
||||
check_path: /api/v1/auth/login
|
||||
username_path: email
|
||||
password_path: password
|
||||
success_handler: lexik_jwt_authentication.handler.authentication_success
|
||||
failure_handler: lexik_jwt_authentication.handler.authentication_failure
|
||||
api:
|
||||
pattern: ^/api
|
||||
stateless: true
|
||||
provider: app_user_provider
|
||||
jwt: ~
|
||||
main:
|
||||
lazy: true
|
||||
provider: app_user_provider
|
||||
@@ -48,6 +63,11 @@ security:
|
||||
# Easy way to control access for large sections of your site
|
||||
# Note: Only the *first* access control that matches will be used
|
||||
access_control:
|
||||
- { path: ^/api/v1/auth/login$, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/api/v1/reviews$, roles: ROLE_USER, methods: [POST] }
|
||||
- { path: ^/api/v1/reviews/[0-9]+$, roles: ROLE_USER, methods: [PUT, PATCH, DELETE] }
|
||||
- { path: ^/api/v1/albums/ingest$, roles: ROLE_USER, methods: [POST] }
|
||||
- { path: ^/api, roles: PUBLIC_ACCESS }
|
||||
- { path: ^/admin/settings, roles: ROLE_ADMIN }
|
||||
- { path: ^/admin/users, roles: ROLE_MODERATOR }
|
||||
- { path: ^/admin/dashboard, roles: ROLE_MODERATOR }
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
api_login_check:
|
||||
path: /api/v1/auth/login
|
||||
+11
-3
@@ -20,10 +20,14 @@ services:
|
||||
# add more service definitions when explicit configuration is needed
|
||||
# please note that last definitions always *replace* previous ones
|
||||
|
||||
App\Service\SpotifyClient:
|
||||
GuzzleHttp\Client:
|
||||
arguments:
|
||||
$clientId: '%env(default::SPOTIFY_CLIENT_ID)%'
|
||||
$clientSecret: '%env(default::SPOTIFY_CLIENT_SECRET)%'
|
||||
$config: { timeout: 10.0, connect_timeout: 5.0, http_errors: false }
|
||||
|
||||
App\Service\LastFmClient:
|
||||
arguments:
|
||||
$httpClient: '@GuzzleHttp\Client'
|
||||
$apiKey: '%env(default::LASTFM_API_KEY)%'
|
||||
|
||||
App\Service\UploadStorage:
|
||||
arguments:
|
||||
@@ -33,3 +37,7 @@ services:
|
||||
App\Controller\AlbumController:
|
||||
arguments:
|
||||
$searchLimit: '%album_search_limit%'
|
||||
|
||||
App\Controller\Api\V1\AlbumApiController:
|
||||
arguments:
|
||||
$searchLimit: '%album_search_limit%'
|
||||
Reference in new issue
Block a user