change key name

This commit is contained in:
aynsix
2020-08-06 16:14:17 +03:00
parent 9f3ffc8de3
commit baf22aae86
9 changed files with 13 additions and 15 deletions

View File

@@ -232,8 +232,8 @@ session:
lifetime: 604800 # 1 week lifetime: 604800 # 1 week
registry: registry:
api-clients: api-clients:
api_require_ssl: false api-require-ssl: false
api_token_header_only: false api-auth-token-header-only: false
crossdomain: crossdomain:
site-control: 'master-only' site-control: 'master-only'
allow-access-from: allow-access-from:

View File

@@ -52,8 +52,8 @@ bin/setup system:config set workers.queue.worker-queue.vhost /
## enable API and disable ssl on it ## enable API and disable ssl on it
/var/alchemy/Phraseanet/bin/setup system:config set registry.api-clients.api-enabled $PHRASEANET_API_ENABLED /var/alchemy/Phraseanet/bin/setup system:config set registry.api-clients.api-enabled $PHRASEANET_API_ENABLED
/var/alchemy/Phraseanet/bin/setup system:config set registry.api-clients.api_require_ssl $PHRASEANET_API_SSL /var/alchemy/Phraseanet/bin/setup system:config set registry.api-clients.api-require-ssl $PHRASEANET_API_SSL
/var/alchemy/Phraseanet/bin/setup system:config set registry.api-clients.api_token_header_only $PHRASEANET_API_TOKEN_HEADER_ONLY /var/alchemy/Phraseanet/bin/setup system:config set registry.api-clients.api-auth-token-header-only $PHRASEANET_API_TOKEN_HEADER_ONLY
## Trusted proxie setting ## Trusted proxie setting

View File

@@ -34,8 +34,8 @@ if [ -f "$FILE" ]; then
bin/setup system:config set main.binaries.exiftool_timeout $PHRASEANET_EXIFTOOL_TIMEOUT bin/setup system:config set main.binaries.exiftool_timeout $PHRASEANET_EXIFTOOL_TIMEOUT
bin/setup system:config set registry.api-clients.api-enabled $PHRASEANET_API_ENABLED bin/setup system:config set registry.api-clients.api-enabled $PHRASEANET_API_ENABLED
bin/setup system:config set registry.api-clients.api_require_ssl $PHRASEANET_API_SSL bin/setup system:config set registry.api-clients.api-require-ssl $PHRASEANET_API_SSL
bin/setup system:config set registry.api-clients.api_token_header_only $PHRASEANET_API_TOKEN_HEADER_ONLY bin/setup system:config set registry.api-clients.api-auth-token-header-only $PHRASEANET_API_TOKEN_HEADER_ONLY
if [[ $PHRASEANET_SMTP_ENABLED && $PHRASEANET_SMTP_ENABLED = true ]]; then if [[ $PHRASEANET_SMTP_ENABLED && $PHRASEANET_SMTP_ENABLED = true ]]; then

View File

@@ -282,8 +282,8 @@ class OAuth2Controller extends Controller
/** @var PropertyAccess $config */ /** @var PropertyAccess $config */
$config = $this->app['conf']; $config = $this->app['conf'];
if ( ! $request->isSecure() && $config->get(['registry', 'api-clients', 'api_require_ssl'], true) == true) { if ( ! $request->isSecure() && $config->get(['registry', 'api-clients', 'api-require-ssl'], true) == true) {
throw new HttpException(400, 'This route requires the use of the https scheme: ' . $config->get(['main', 'api_require_ssl']), null, ['content-type' => 'application/json']); throw new HttpException(400, 'This route requires the use of the https scheme: ' . $config->get(['registry', 'api-clients', 'api-require-ssl']), null, ['content-type' => 'application/json']);
} }
$this->oAuth2Adapter->grantAccessToken(); $this->oAuth2Adapter->grantAccessToken();

View File

@@ -537,7 +537,7 @@ class API_OAuth2_Adapter extends OAuth2
public function verifyAccessToken($scope = null, $exit_not_present = true, $exit_invalid = true, $exit_expired = true, $exit_scope = true, $realm = null) public function verifyAccessToken($scope = null, $exit_not_present = true, $exit_invalid = true, $exit_expired = true, $exit_scope = true, $realm = null)
{ {
$apiTokenHeader = $this->app['conf']->get(['registry', 'api-clients', 'api_token_header_only']); $apiTokenHeader = $this->app['conf']->get(['registry', 'api-clients', 'api-auth-token-header-only']);
$useTokenHeader = $this->useTokenHeaderChoice($apiTokenHeader); $useTokenHeader = $this->useTokenHeaderChoice($apiTokenHeader);

View File

@@ -54,18 +54,18 @@ class patch_412 implements patchInterface
*/ */
public function apply(base $appbox, Application $app) public function apply(base $appbox, Application $app)
{ {
// move api_require_ssl place in configuration.yml // move api-require-ssl place in configuration.yml
if ($app['conf']->has(['main', 'api_require_ssl'])) { if ($app['conf']->has(['main', 'api_require_ssl'])) {
$apiRequireSslValue = $app['conf']->get(['main', 'api_require_ssl']); $apiRequireSslValue = $app['conf']->get(['main', 'api_require_ssl']);
$app['conf']->remove(['main', 'api_require_ssl']); $app['conf']->remove(['main', 'api_require_ssl']);
$app['conf']->set(['registry', 'api-clients', 'api_require_ssl'], $apiRequireSslValue); $app['conf']->set(['registry', 'api-clients', 'api-require-ssl'], $apiRequireSslValue);
} }
// change api_token_header place and name in configuration.yml // change api_token_header place and name in configuration.yml
if ($app['conf']->has(['main', 'api_token_header'])) { if ($app['conf']->has(['main', 'api_token_header'])) {
$apiTokenHeaderValue = $app['conf']->get(['main', 'api_token_header']); $apiTokenHeaderValue = $app['conf']->get(['main', 'api_token_header']);
$app['conf']->remove(['main', 'api_token_header']); $app['conf']->remove(['main', 'api_token_header']);
$app['conf']->set(['registry', 'api-clients', 'api_token_header_only'], $apiTokenHeaderValue); $app['conf']->set(['registry', 'api-clients', 'api-auth-token-header-only'], $apiTokenHeaderValue);
} }
// add svg in extension-mapping // add svg in extension-mapping

View File

@@ -50,7 +50,7 @@
chdir: /vagrant/ chdir: /vagrant/
- name: Disable API SSL requirement - name: Disable API SSL requirement
shell: php bin/setup system:config set registry.api-clients.api_require_ssl false shell: php bin/setup system:config set registry.api-clients.api-require-ssl false
args: args:
chdir: /vagrant/ chdir: /vagrant/

View File

@@ -5,7 +5,6 @@ languages:
main: main:
maintenance: false maintenance: false
key: '' key: ''
api_require_ssl: true
database: database:
host: 'sql-host' host: 'sql-host'
port: 3306 port: 3306

View File

@@ -5,7 +5,6 @@ languages:
main: main:
maintenance: false maintenance: false
key: '' key: ''
api_require_ssl: true
delete-account-require-email-confirmation: true delete-account-require-email-confirmation: true
database: database:
host: 'sql-host' host: 'sql-host'