Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d04bde
commit 0baf7b3
Showing
8 changed files
with
118 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Shopsys\ApiBundle\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Shopsys\MigrationBundle\Component\Doctrine\Migrations\AbstractMigration; | ||
|
||
class Version20190524102901 extends AbstractMigration | ||
{ | ||
/** | ||
* @param \Doctrine\DBAL\Schema\Schema $schema | ||
*/ | ||
public function up(Schema $schema) | ||
{ | ||
$this->sql('CREATE TABLE oauth2_access_token (identifier CHAR(80) NOT NULL, client VARCHAR(32) NOT NULL, expiry TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, user_identifier VARCHAR(128) DEFAULT NULL, scopes TEXT DEFAULT NULL, revoked BOOLEAN NOT NULL, PRIMARY KEY(identifier));'); | ||
$this->sql('CREATE INDEX IDX_454D9673C7440455 ON oauth2_access_token (client);'); | ||
$this->sql('COMMENT ON COLUMN oauth2_access_token.scopes IS \'(DC2Type:oauth2_scope)\';'); | ||
$this->sql('CREATE TABLE oauth2_client (identifier VARCHAR(32) NOT NULL, secret VARCHAR(128) NOT NULL, redirect_uris TEXT DEFAULT NULL, grants TEXT DEFAULT NULL, scopes TEXT DEFAULT NULL, active BOOLEAN NOT NULL, PRIMARY KEY(identifier));'); | ||
$this->sql('COMMENT ON COLUMN oauth2_client.redirect_uris IS \'(DC2Type:oauth2_redirect_uri)\';'); | ||
$this->sql('COMMENT ON COLUMN oauth2_client.grants IS \'(DC2Type:oauth2_grant)\';'); | ||
$this->sql('COMMENT ON COLUMN oauth2_client.scopes IS \'(DC2Type:oauth2_scope)\';'); | ||
$this->sql('CREATE TABLE oauth2_refresh_token (identifier CHAR(80) NOT NULL, access_token CHAR(80) NOT NULL, expiry TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, revoked BOOLEAN NOT NULL, PRIMARY KEY(identifier));'); | ||
$this->sql('CREATE INDEX IDX_4DD90732B6A2DD68 ON oauth2_refresh_token (access_token);'); | ||
$this->sql('ALTER TABLE oauth2_access_token ADD CONSTRAINT FK_454D9673C7440455 FOREIGN KEY (client) REFERENCES oauth2_client (identifier) NOT DEFERRABLE INITIALLY IMMEDIATE;'); | ||
$this->sql('ALTER TABLE oauth2_refresh_token ADD CONSTRAINT FK_4DD90732B6A2DD68 FOREIGN KEY (access_token) REFERENCES oauth2_access_token (identifier) NOT DEFERRABLE INITIALLY IMMEDIATE;'); | ||
} | ||
|
||
/** | ||
* @param \Doctrine\DBAL\Schema\Schema $schema | ||
*/ | ||
public function down(Schema $schema) | ||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
trikoder_oauth2: | ||
authorization_server: | ||
# Full path to the private key file. | ||
# How to generate a private key: https://oauth2.thephpleague.com/installation/#generating-public-and-private-keys | ||
private_key: '%shopsys.root_dir%/app/config/private.key' | ||
|
||
# The string used as an encryption key. | ||
# How to generate an encryption key: https://oauth2.thephpleague.com/installation/#string-password | ||
encryption_key: iRuA3af4/Fva1lujo+7y3f9LUI8a7n1TVNw8WZvF1Tw= | ||
|
||
# How long the issued access token should be valid for. | ||
# The value should be a valid interval: http://php.net/manual/en/dateinterval.construct.php#refsect1-dateinterval.construct-parameters | ||
access_token_ttl: PT1H | ||
|
||
# How long the issued refresh token should be valid for. | ||
# The value should be a valid interval: http://php.net/manual/en/dateinterval.construct.php#refsect1-dateinterval.construct-parameters | ||
refresh_token_ttl: P1M | ||
|
||
resource_server: | ||
# Full path to the public key file | ||
# How to generate a public key: https://oauth2.thephpleague.com/installation/#generating-public-and-private-keys | ||
public_key: '%shopsys.root_dir%/app/config/public.key' | ||
|
||
# Scopes that you wish to utilize in your application. | ||
# This should be a simple array of strings. | ||
scopes: [] | ||
|
||
# Configures different persistence methods that can be used by the bundle for saving client and token data. | ||
# Only one persistence method can be configured at a time. | ||
persistence: | ||
doctrine: | ||
# Name of the entity manager that you wish to use for managing clients and tokens. | ||
entity_manager: default # Required |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-----BEGIN RSA PRIVATE KEY----- | ||
MIIEpQIBAAKCAQEA4Y3boig3D3Si/OxTJfGz2bm68lTydupL0f5vFU1pPfQ73eKR | ||
p7oFH2i5TNKtUY5Ys48Sr/iyv4s10YhjhouJmt/3OvaFD09yo07Vi7osoPqFZWIc | ||
84Z0lNmZxRjNhD5K3eIqKGBE9894mpSG4OoiWv610RvVdHOLNLq/tQtBWHwILPS/ | ||
vkSn5pZxcBaLX285s5qGXskBLrbuU9oqZvfIArXxNhrVuGlhmMFKJ0cFOJ45OTtp | ||
ogBQYaLt0m8AN4RDE9Qy11t88mR2pLfHJlyx3gw2kh5itL9GkKsnfNS+zxh+2XqO | ||
G9oLsvtNskQEyjEa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kqkWOnlKw3H0WUxspZmLB0A4XdUwM1d+hHN5P80oWZvTRRk4y65J0BzIEcQiFHL | ||
Jb5gIZECgYEAtNeBia3WRDx5oWkgrQV30ykuOT5XMCaCSxzQkTCILCZ2mNbZ4pS1 | ||
Lhx7/h1v3IC+xbSTIEtWwtoZB8K3HcUGqA/eMLx5kwp9TnM5W2AzTO6AouxiQD0E | ||
GzN9fI2yAxeS8A1DrRX/U/89p/swBT3E+GJ0/3KfTu9onaT/um1XpsY= | ||
-----END RSA PRIVATE KEY----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-----BEGIN PUBLIC KEY----- | ||
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4Y3boig3D3Si/OxTJfGz | ||
2bm68lTydupL0f5vFU1pPfQ73eKRp7oFH2i5TNKtUY5Ys48Sr/iyv4s10YhjhouJ | ||
mt/3OvaFD09yo07Vi7osoPqFZWIc84Z0lNmZxRjNhD5K3eIqKGBE9894mpSG4Ooi | ||
Wv610RvVdHOLNLq/tQtBWHwILPS/vkSn5pZxcBaLX285s5qGXskBLrbuU9oqZvfI | ||
ArXxNhrVuGlhmMFKJ0cFOJ45OTtpogBQYaLt0m8AN4RDE9Qy11t88mR2pLfHJlyx | ||
3gw2kh5itL9GkKsnfNS+zxh+2XqOG9oLsvtNskQEyjEaBXUX3r7B1lulHTibvnyl | ||
1QIDAQAB | ||
-----END PUBLIC KEY----- |