Implemented interaction with docker registry.

This commit is contained in:
2024-07-06 18:07:13 +05:00
parent a8d656148a
commit 10ccf2f800
155 changed files with 5142 additions and 89 deletions

View File

@@ -0,0 +1,103 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| service_name
|--------------------------------------------------------------------------
|
| The parameter must match the parameter from the registry service
| auth:
| token:
| service:
|
*/
'service_name' => env('REGISTRY_SERVICE_NAME'),
/*
|--------------------------------------------------------------------------
| service_http
|--------------------------------------------------------------------------
|
| Register of real addresses
|
*/
'service_http' => env('REGISTRY_SERVICE_HTTP'),
/*
|--------------------------------------------------------------------------
| private_key_name
|--------------------------------------------------------------------------
|
| Executing commands:
| openssl req -nodes -newkey rsa:4096 -keyout registry-auth1.key -out registry-auth1.csr -subj "/CN=token_issuer"
| openssl x509 -in registry-auth1.csr -out registry-auth1.crt -req -signkey registry-auth1.key -days 3650
|
| The file name corresponds to the name registry-auth1.key.
|
*/
'private_key_name' => env('REGISTRY_PRIVATE_KEY_NAME'),
/*
|--------------------------------------------------------------------------
| issuer
|--------------------------------------------------------------------------
|
| The parameter must match the parameter from the registry service
| auth:
| token:
| issuer:
|
| Executing commands:
| openssl req -nodes -newkey rsa:4096 -keyout registry-auth1.key -out registry-auth1.csr -subj "/CN=token_issuer"
| openssl x509 -in registry-auth1.csr -out registry-auth1.crt -req -signkey registry-auth1.key -days 3650
|
| auth:
| token:
| issuer: token_issuer
|
| Where it is better to name token_issuer in your own way.
|
*/
'issuer' => env('REGISTRY_ISSUER'),
/*
|--------------------------------------------------------------------------
| algorithm
|--------------------------------------------------------------------------
|
| Supported algorithms are 'ES384','ES256', 'ES256K', 'HS256', 'HS384',
| 'HS512', 'RS256', 'RS384', and 'RS512'. Testing only RS256.
|
| openssl req -nodes -newkey rsa:4096 -keyout registry-auth1.key -out registry-auth1.csr -subj "/CN=token_issuer"
| openssl x509 -in registry-auth1.csr -out registry-auth1.crt -req -signkey registry-auth1.key -days 3650
|
| If you created a key using this command, then the algorithm will be RS256.
|
*/
'algorithm' => env('REGISTRY_ALGORITHM', 'RS256'),
/*
|--------------------------------------------------------------------------
| expires_in_seconds
|--------------------------------------------------------------------------
|
| For how many seconds to issue an authorization token.
|
*/
'expires_in_seconds' => (int) env('REGISTRY_EXPIRES_IN_SECONDS', 600),
/*
|--------------------------------------------------------------------------
| token_for_notifications
|--------------------------------------------------------------------------
|
| The parameter must match the parameter from the registry service
| notifications:
| endpoints:
| headers:
| Authorization: [REGISTRY_TOKEN_FOR_NOTIFICATIONS]
|
*/
'token_for_notifications' => env('REGISTRY_TOKEN_FOR_NOTIFICATIONS'),
];

View File

@@ -0,0 +1,83 @@
<?php
use Laravel\Sanctum\Sanctum;
return [
/*
|--------------------------------------------------------------------------
| Stateful Domains
|--------------------------------------------------------------------------
|
| Requests from the following domains / hosts will receive stateful API
| authentication cookies. Typically, these should include your local
| and production domains which access your API via a frontend SPA.
|
*/
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
'%s%s',
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
Sanctum::currentApplicationUrlWithPort()
))),
/*
|--------------------------------------------------------------------------
| Sanctum Guards
|--------------------------------------------------------------------------
|
| This array contains the authentication guards that will be checked when
| Sanctum is trying to authenticate a request. If none of these guards
| are able to authenticate the request, Sanctum will use the bearer
| token that's present on an incoming request for authentication.
|
*/
'guard' => ['web'],
/*
|--------------------------------------------------------------------------
| Expiration Minutes
|--------------------------------------------------------------------------
|
| This value controls the number of minutes until an issued token will be
| considered expired. This will override any values set in the token's
| "expires_at" attribute, but first-party sessions are not affected.
|
*/
'expiration' => null,
/*
|--------------------------------------------------------------------------
| Token Prefix
|--------------------------------------------------------------------------
|
| Sanctum can prefix new tokens in order to take advantage of numerous
| security scanning initiatives maintained by open source platforms
| that notify developers if they commit tokens into repositories.
|
| See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning
|
*/
'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''),
/*
|--------------------------------------------------------------------------
| Sanctum Middleware
|--------------------------------------------------------------------------
|
| When authenticating your first-party SPA with Sanctum you may need to
| customize some of the middleware Sanctum uses while processing the
| request. You may change the middleware listed below as required.
|
*/
'middleware' => [
'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class,
'encrypt_cookies' => Illuminate\Cookie\Middleware\EncryptCookies::class,
'validate_csrf_token' => Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class,
],
];