From d4af2280bb51025d214cb5f889d169c18310f9aa Mon Sep 17 00:00:00 2001 From: Patrick Landolt Date: Sat, 18 Nov 2017 10:35:07 +0100 Subject: [PATCH 1/5] mailxpert apibundle --- .../config/packages/mailxpert_apibundle.yaml | 6 +++++ .../config/routes/mailxpert_apibundle.yaml | 3 +++ mailxpert/apibundle/0.1/manifest.json | 9 +++++++ .../apibundle/0.1/src/Entity/AccessToken.php | 26 +++++++++++++++++++ 4 files changed, 44 insertions(+) create mode 100644 mailxpert/apibundle/0.1/config/packages/mailxpert_apibundle.yaml create mode 100644 mailxpert/apibundle/0.1/config/routes/mailxpert_apibundle.yaml create mode 100644 mailxpert/apibundle/0.1/manifest.json create mode 100644 mailxpert/apibundle/0.1/src/Entity/AccessToken.php diff --git a/mailxpert/apibundle/0.1/config/packages/mailxpert_apibundle.yaml b/mailxpert/apibundle/0.1/config/packages/mailxpert_apibundle.yaml new file mode 100644 index 00000000..f1d4ecb2 --- /dev/null +++ b/mailxpert/apibundle/0.1/config/packages/mailxpert_apibundle.yaml @@ -0,0 +1,6 @@ +mailxpert_api: + access_token_class: App\Entity\AccessToken + oauth: + client_id: 'client_id_to_replace' + client_secret: 'client_secret_to_replace' + redirect_url: 'http://example.com/mx/oauth/code' diff --git a/mailxpert/apibundle/0.1/config/routes/mailxpert_apibundle.yaml b/mailxpert/apibundle/0.1/config/routes/mailxpert_apibundle.yaml new file mode 100644 index 00000000..1bfba390 --- /dev/null +++ b/mailxpert/apibundle/0.1/config/routes/mailxpert_apibundle.yaml @@ -0,0 +1,3 @@ +mx_api: + resource: '@MailxpertAPIBundle/Resources/config/routing.xml' + type: xml diff --git a/mailxpert/apibundle/0.1/manifest.json b/mailxpert/apibundle/0.1/manifest.json new file mode 100644 index 00000000..cf87e333 --- /dev/null +++ b/mailxpert/apibundle/0.1/manifest.json @@ -0,0 +1,9 @@ +{ + "bundles": { + "Mailxpert\\APIBundle\\MailxpertAPIBundle": ["all"] + }, + "copy-from-recipe": { + "config/": "%CONFIG_DIR%/", + "src/Entity/AccessToken.php": "%SRC_DIR%/Entity/AccessToken.php" + } +} diff --git a/mailxpert/apibundle/0.1/src/Entity/AccessToken.php b/mailxpert/apibundle/0.1/src/Entity/AccessToken.php new file mode 100644 index 00000000..5d1b22d7 --- /dev/null +++ b/mailxpert/apibundle/0.1/src/Entity/AccessToken.php @@ -0,0 +1,26 @@ + Date: Sat, 18 Nov 2017 12:26:54 +0100 Subject: [PATCH 2/5] fixed class namespace --- mailxpert/apibundle/0.1/src/Entity/AccessToken.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailxpert/apibundle/0.1/src/Entity/AccessToken.php b/mailxpert/apibundle/0.1/src/Entity/AccessToken.php index 5d1b22d7..298ab24b 100644 --- a/mailxpert/apibundle/0.1/src/Entity/AccessToken.php +++ b/mailxpert/apibundle/0.1/src/Entity/AccessToken.php @@ -1,6 +1,6 @@ Date: Tue, 21 Nov 2017 08:47:41 +0100 Subject: [PATCH 3/5] using env vars for id and secreat; removing dummy constructor --- .../apibundle/0.1/config/packages/mailxpert_apibundle.yaml | 4 ++-- mailxpert/apibundle/0.1/manifest.json | 4 ++++ mailxpert/apibundle/0.1/src/Entity/AccessToken.php | 5 ----- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/mailxpert/apibundle/0.1/config/packages/mailxpert_apibundle.yaml b/mailxpert/apibundle/0.1/config/packages/mailxpert_apibundle.yaml index f1d4ecb2..dfe16373 100644 --- a/mailxpert/apibundle/0.1/config/packages/mailxpert_apibundle.yaml +++ b/mailxpert/apibundle/0.1/config/packages/mailxpert_apibundle.yaml @@ -1,6 +1,6 @@ mailxpert_api: access_token_class: App\Entity\AccessToken oauth: - client_id: 'client_id_to_replace' - client_secret: 'client_secret_to_replace' + client_id: '%env(MAILXPERT_CLIENT_ID)%' + client_secret: '%env(MAILXPERT_CLIENT_SECRET)%' redirect_url: 'http://example.com/mx/oauth/code' diff --git a/mailxpert/apibundle/0.1/manifest.json b/mailxpert/apibundle/0.1/manifest.json index cf87e333..6530da9a 100644 --- a/mailxpert/apibundle/0.1/manifest.json +++ b/mailxpert/apibundle/0.1/manifest.json @@ -5,5 +5,9 @@ "copy-from-recipe": { "config/": "%CONFIG_DIR%/", "src/Entity/AccessToken.php": "%SRC_DIR%/Entity/AccessToken.php" + }, + "env": { + "MAILXPERT_CLIENT_ID": "mailxpert_client_id_to_replace", + "MAILXPERT_CLIENT_SECRET": "mailxpert_client_secret_to_replace" } } diff --git a/mailxpert/apibundle/0.1/src/Entity/AccessToken.php b/mailxpert/apibundle/0.1/src/Entity/AccessToken.php index 298ab24b..24bbb4bc 100644 --- a/mailxpert/apibundle/0.1/src/Entity/AccessToken.php +++ b/mailxpert/apibundle/0.1/src/Entity/AccessToken.php @@ -18,9 +18,4 @@ class AccessToken extends BaseAccessToken */ protected $id; - public function __construct() - { - parent::__construct(); - // your own logic - } } From 06b2b387de41a195c5410278d9be09ef182e28ba Mon Sep 17 00:00:00 2001 From: Patrick Landolt Date: Tue, 21 Nov 2017 08:52:24 +0100 Subject: [PATCH 4/5] removed empty line --- mailxpert/apibundle/0.1/src/Entity/AccessToken.php | 1 - 1 file changed, 1 deletion(-) diff --git a/mailxpert/apibundle/0.1/src/Entity/AccessToken.php b/mailxpert/apibundle/0.1/src/Entity/AccessToken.php index 24bbb4bc..5a54ce3f 100644 --- a/mailxpert/apibundle/0.1/src/Entity/AccessToken.php +++ b/mailxpert/apibundle/0.1/src/Entity/AccessToken.php @@ -17,5 +17,4 @@ class AccessToken extends BaseAccessToken * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; - } From 4c21e4a73635d405525eb43c13c8fa5ba224c6aa Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 24 Nov 2017 07:11:52 -0800 Subject: [PATCH 5/5] fixed config --- mailxpert/apibundle/0.1/manifest.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mailxpert/apibundle/0.1/manifest.json b/mailxpert/apibundle/0.1/manifest.json index 6530da9a..95e4f339 100644 --- a/mailxpert/apibundle/0.1/manifest.json +++ b/mailxpert/apibundle/0.1/manifest.json @@ -4,7 +4,7 @@ }, "copy-from-recipe": { "config/": "%CONFIG_DIR%/", - "src/Entity/AccessToken.php": "%SRC_DIR%/Entity/AccessToken.php" + "src/": "%SRC_DIR%/" }, "env": { "MAILXPERT_CLIENT_ID": "mailxpert_client_id_to_replace",