diff options
author | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2015-10-06 09:19:06 +0200 |
---|---|---|
committer | Jeremy Benoist <j0k3r@users.noreply.github.com> | 2015-10-06 09:19:06 +0200 |
commit | 16dabc326311f084d671be188c7941bbb3c341c9 (patch) | |
tree | 3210a7688ea2bfa1bff5fd0422b52adf570edcdc /src/Wallabag/ApiBundle/Entity | |
parent | fdef5f460524215d806e244e5546865f4b8e01df (diff) | |
parent | 8263e71192989dc0fd28a41ac22f9c5b32eb11c4 (diff) | |
download | wallabag-16dabc326311f084d671be188c7941bbb3c341c9.tar.gz wallabag-16dabc326311f084d671be188c7941bbb3c341c9.tar.zst wallabag-16dabc326311f084d671be188c7941bbb3c341c9.zip |
Merge pull request #1436 from wallabag/v2-register
Public registration & oAuth2 \o/
Diffstat (limited to 'src/Wallabag/ApiBundle/Entity')
-rw-r--r-- | src/Wallabag/ApiBundle/Entity/AccessToken.php | 31 | ||||
-rw-r--r-- | src/Wallabag/ApiBundle/Entity/AuthCode.php | 31 | ||||
-rw-r--r-- | src/Wallabag/ApiBundle/Entity/Client.php | 25 | ||||
-rw-r--r-- | src/Wallabag/ApiBundle/Entity/RefreshToken.php | 31 |
4 files changed, 118 insertions, 0 deletions
diff --git a/src/Wallabag/ApiBundle/Entity/AccessToken.php b/src/Wallabag/ApiBundle/Entity/AccessToken.php new file mode 100644 index 00000000..b1f4e7de --- /dev/null +++ b/src/Wallabag/ApiBundle/Entity/AccessToken.php | |||
@@ -0,0 +1,31 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\ApiBundle\Entity; | ||
4 | |||
5 | use FOS\OAuthServerBundle\Entity\AccessToken as BaseAccessToken; | ||
6 | use Doctrine\ORM\Mapping as ORM; | ||
7 | |||
8 | /** | ||
9 | * @ORM\Table("oauth2_access_tokens") | ||
10 | * @ORM\Entity | ||
11 | */ | ||
12 | class AccessToken extends BaseAccessToken | ||
13 | { | ||
14 | /** | ||
15 | * @ORM\Id | ||
16 | * @ORM\Column(type="integer") | ||
17 | * @ORM\GeneratedValue(strategy="AUTO") | ||
18 | */ | ||
19 | protected $id; | ||
20 | |||
21 | /** | ||
22 | * @ORM\ManyToOne(targetEntity="Client") | ||
23 | * @ORM\JoinColumn(nullable=false) | ||
24 | */ | ||
25 | protected $client; | ||
26 | |||
27 | /** | ||
28 | * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User") | ||
29 | */ | ||
30 | protected $user; | ||
31 | } | ||
diff --git a/src/Wallabag/ApiBundle/Entity/AuthCode.php b/src/Wallabag/ApiBundle/Entity/AuthCode.php new file mode 100644 index 00000000..81398158 --- /dev/null +++ b/src/Wallabag/ApiBundle/Entity/AuthCode.php | |||
@@ -0,0 +1,31 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\ApiBundle\Entity; | ||
4 | |||
5 | use FOS\OAuthServerBundle\Entity\AuthCode as BaseAuthCode; | ||
6 | use Doctrine\ORM\Mapping as ORM; | ||
7 | |||
8 | /** | ||
9 | * @ORM\Table("oauth2_auth_codes") | ||
10 | * @ORM\Entity | ||
11 | */ | ||
12 | class AuthCode extends BaseAuthCode | ||
13 | { | ||
14 | /** | ||
15 | * @ORM\Id | ||
16 | * @ORM\Column(type="integer") | ||
17 | * @ORM\GeneratedValue(strategy="AUTO") | ||
18 | */ | ||
19 | protected $id; | ||
20 | |||
21 | /** | ||
22 | * @ORM\ManyToOne(targetEntity="Client") | ||
23 | * @ORM\JoinColumn(nullable=false) | ||
24 | */ | ||
25 | protected $client; | ||
26 | |||
27 | /** | ||
28 | * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User") | ||
29 | */ | ||
30 | protected $user; | ||
31 | } | ||
diff --git a/src/Wallabag/ApiBundle/Entity/Client.php b/src/Wallabag/ApiBundle/Entity/Client.php new file mode 100644 index 00000000..d449870a --- /dev/null +++ b/src/Wallabag/ApiBundle/Entity/Client.php | |||
@@ -0,0 +1,25 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\ApiBundle\Entity; | ||
4 | |||
5 | use FOS\OAuthServerBundle\Entity\Client as BaseClient; | ||
6 | use Doctrine\ORM\Mapping as ORM; | ||
7 | |||
8 | /** | ||
9 | * @ORM\Table("oauth2_clients") | ||
10 | * @ORM\Entity | ||
11 | */ | ||
12 | class Client extends BaseClient | ||
13 | { | ||
14 | /** | ||
15 | * @ORM\Id | ||
16 | * @ORM\Column(type="integer") | ||
17 | * @ORM\GeneratedValue(strategy="AUTO") | ||
18 | */ | ||
19 | protected $id; | ||
20 | |||
21 | public function __construct() | ||
22 | { | ||
23 | parent::__construct(); | ||
24 | } | ||
25 | } | ||
diff --git a/src/Wallabag/ApiBundle/Entity/RefreshToken.php b/src/Wallabag/ApiBundle/Entity/RefreshToken.php new file mode 100644 index 00000000..be2c1d2e --- /dev/null +++ b/src/Wallabag/ApiBundle/Entity/RefreshToken.php | |||
@@ -0,0 +1,31 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\ApiBundle\Entity; | ||
4 | |||
5 | use FOS\OAuthServerBundle\Entity\RefreshToken as BaseRefreshToken; | ||
6 | use Doctrine\ORM\Mapping as ORM; | ||
7 | |||
8 | /** | ||
9 | * @ORM\Table("oauth2_refresh_tokens") | ||
10 | * @ORM\Entity | ||
11 | */ | ||
12 | class RefreshToken extends BaseRefreshToken | ||
13 | { | ||
14 | /** | ||
15 | * @ORM\Id | ||
16 | * @ORM\Column(type="integer") | ||
17 | * @ORM\GeneratedValue(strategy="AUTO") | ||
18 | */ | ||
19 | protected $id; | ||
20 | |||
21 | /** | ||
22 | * @ORM\ManyToOne(targetEntity="Client") | ||
23 | * @ORM\JoinColumn(nullable=false) | ||
24 | */ | ||
25 | protected $client; | ||
26 | |||
27 | /** | ||
28 | * @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User") | ||
29 | */ | ||
30 | protected $user; | ||
31 | } | ||