Skip to content

Commit 28aa668

Browse files
authored
Merge pull request API-Skeletons#87 from TomHAnderson/feature/bigint
Use all bigint, scope fixture, bcrypt 10
2 parents d08d085 + fc6f2d8 commit 28aa668

24 files changed

+136
-479
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ build
99
/.project
1010
/deployment.properties
1111
/deployment.xml
12+
test/asset/orm-autoload/oauth2.doctrine-orm.global.php

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ This provides a Doctrine adapter for [zfcampus/zf-mvc-auth](https://github.com/z
1111
Versions
1212
--------
1313

14-
The Version 1.x series is for PHP 5.5 to 7.0. The 2.x series is for PHP 7.1 onward.
14+
* 1.x series is for PHP 5.5 to 7.0.
15+
* 2.x series is for PHP 7.1 onward.
16+
* 3.x series is for PHP 7.1 onward and uses bigint instead of integer, scope fixture, and bcrypt cost of 10.
1517

1618
![Entity Relationship Diagram](https://raw.githubusercontent.com/API-Skeletons/zf-oauth2-doctrine/master/media/oauth2-doctrine-erd.png)
1719
Entity Relationship Diagram created with [Skipper](https://skipper18.com)

config/oauth2.doctrine-orm.global.php.dist

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ return array(
1212
'event_manager' => 'doctrine.eventmanager.orm_default',
1313
'driver' => 'doctrine.driver.orm_default',
1414
'enable_default_entities' => true,
15-
'bcrypt_cost' => 14, # match zfcuser
15+
'bcrypt_cost' => 10, # match php default
1616
'auth_identity_fields' => array('username'),
1717
// Dynamically map the user_entity to the client_entity
1818
'dynamic_mapping' => array(
@@ -72,7 +72,7 @@ return array(
7272
'user_id' => array(
7373
'type' => 'field',
7474
'name' => 'id',
75-
'datatype' => 'integer',
75+
'datatype' => 'bigint',
7676
),
7777
'username' => array(
7878
'type' => 'field',
@@ -93,7 +93,7 @@ return array(
9393
'client_id' => array(
9494
'type' => 'field',
9595
'name' => 'clientId',
96-
'datatype' => 'integer',
96+
'datatype' => 'string',
9797
),
9898
'client_secret' => array(
9999
'type' => 'field',
@@ -121,7 +121,7 @@ return array(
121121
'name' => 'user',
122122
'entity_field_name' => 'id',
123123
'entity' => $userEntity,
124-
'datatype' => 'integer',
124+
'datatype' => 'bigint',
125125
'allow_null' => true,
126126
),
127127
),
@@ -151,14 +151,14 @@ return array(
151151
'name' => 'client',
152152
'entity_field_name' => 'clientId',
153153
'entity' => 'ZF\OAuth2\Doctrine\Entity\Client',
154-
'datatype' => 'integer',
154+
'datatype' => 'bigint',
155155
),
156156
'user_id' => array(
157157
'type' => 'relation',
158158
'name' => 'user',
159159
'entity_field_name' => 'id',
160160
'entity' => $userEntity,
161-
'datatype' => 'integer',
161+
'datatype' => 'bigint',
162162
'allow_null' => true,
163163
),
164164
),
@@ -188,14 +188,14 @@ return array(
188188
'name' => 'client',
189189
'entity_field_name' => 'clientId',
190190
'entity' => 'ZF\OAuth2\Doctrine\Entity\Client',
191-
'datatype' => 'integer',
191+
'datatype' => 'bigint',
192192
),
193193
'user_id' => array(
194194
'type' => 'relation',
195195
'name' => 'user',
196196
'entity_field_name' => 'id',
197197
'entity' => $userEntity,
198-
'datatype' => 'integer',
198+
'datatype' => 'bigint',
199199
'allow_null' => true,
200200
),
201201
),
@@ -235,14 +235,14 @@ return array(
235235
'name' => 'client',
236236
'entity_field_name' => 'clientId',
237237
'entity' => 'ZF\OAuth2\Doctrine\Entity\Client',
238-
'datatype' => 'integer',
238+
'datatype' => 'bigint',
239239
),
240240
'user_id' => array(
241241
'type' => 'relation',
242242
'name' => 'user',
243243
'entity_field_name' => 'id',
244244
'entity' => $userEntity,
245-
'datatype' => 'integer',
245+
'datatype' => 'bigint',
246246
'allow_null' => true,
247247
),
248248
),
@@ -266,7 +266,7 @@ return array(
266266
'name' => 'client',
267267
'entity_field_name' => 'clientId',
268268
'entity' => 'ZF\OAuth2\Doctrine\Entity\Client',
269-
'datatype' => 'integer',
269+
'datatype' => 'bigint',
270270
),
271271
),
272272
),
@@ -299,7 +299,7 @@ return array(
299299
'name' => 'client',
300300
'entity_field_name' => 'clientId',
301301
'entity' => 'ZF\OAuth2\Doctrine\Entity\Client',
302-
'datatype' => 'integer',
302+
'datatype' => 'bigint',
303303
),
304304
),
305305
),
@@ -322,7 +322,7 @@ return array(
322322
'name' => 'client',
323323
'entity_field_name' => 'clientId',
324324
'entity' => 'ZF\OAuth2\Doctrine\Entity\Client',
325-
'datatype' => 'integer',
325+
'datatype' => 'bigint',
326326
),
327327
),
328328
),
@@ -350,7 +350,7 @@ return array(
350350
'name' => 'client',
351351
'entity_field_name' => 'clientId',
352352
'entity' => 'ZF\OAuth2\Doctrine\Entity\Client',
353-
'datatype' => 'integer',
353+
'datatype' => 'bigint',
354354
),
355355
),
356356
),

config/orm/ZF.OAuth2.Doctrine.Entity.AccessToken.dcm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
33
<entity name="ZF\OAuth2\Doctrine\Entity\AccessToken" table="AccessToken_OAuth2">
4-
<id name="id" type="integer">
4+
<id name="id" type="bigint">
55
<generator strategy="AUTO"/>
66
</id>
77
<field name="accessToken" type="text" nullable="true"/>

config/orm/ZF.OAuth2.Doctrine.Entity.AuthorizationCode.dcm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
33
<entity name="ZF\OAuth2\Doctrine\Entity\AuthorizationCode" table="AuthorizationCode_OAuth2">
4-
<id name="id" type="integer">
4+
<id name="id" type="bigint">
55
<generator strategy="AUTO"/>
66
</id>
77
<field name="authorizationCode" type="string" nullable="true"/>

config/orm/ZF.OAuth2.Doctrine.Entity.Client.dcm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
33
<entity name="ZF\OAuth2\Doctrine\Entity\Client" table="Client_OAuth2">
4-
<id name="id" type="integer">
4+
<id name="id" type="bigint">
55
<generator strategy="AUTO"/>
66
</id>
77
<field name="clientId" type="string" nullable="true"/>

config/orm/ZF.OAuth2.Doctrine.Entity.Jti.dcm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
33
<entity name="ZF\OAuth2\Doctrine\Entity\Jti" table="Jti_OAuth2">
4-
<id name="id" type="integer">
4+
<id name="id" type="bigint">
55
<generator strategy="AUTO"/>
66
</id>
77
<field name="subject" type="string" nullable="true"/>

config/orm/ZF.OAuth2.Doctrine.Entity.Jwt.dcm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
33
<entity name="ZF\OAuth2\Doctrine\Entity\Jwt" table="Jwt_OAuth2">
4-
<id name="id" type="integer">
4+
<id name="id" type="bigint">
55
<generator strategy="AUTO"/>
66
</id>
77
<field name="subject" type="string" nullable="true"/>

config/orm/ZF.OAuth2.Doctrine.Entity.PublicKey.dcm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
33
<entity name="ZF\OAuth2\Doctrine\Entity\PublicKey" table="PublicKey_OAuth2">
4-
<id name="id" type="integer">
4+
<id name="id" type="bigint">
55
<generator strategy="AUTO"/>
66
</id>
77
<field name="publicKey" type="text" nullable="true"/>

config/orm/ZF.OAuth2.Doctrine.Entity.RefreshToken.dcm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0"?>
22
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xsi="http://www.w3.org/2001/XMLSchema-instance" schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
33
<entity name="ZF\OAuth2\Doctrine\Entity\RefreshToken" table="RefreshToken_OAuth2">
4-
<id name="id" type="integer">
4+
<id name="id" type="bigint">
55
<generator strategy="AUTO"/>
66
</id>
77
<field name="refreshToken" type="string" nullable="true"/>

0 commit comments

Comments
 (0)