Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
bb15224
adds the idea of user tokens
markhuot Jun 1, 2018
286d229
uses jwt for user tokens
markhuot Jun 8, 2018
c1f56ec
adds jwt and some permissions around users
markhuot Jun 8, 2018
e997651
per user tokens working
markhuot Jun 11, 2018
20b9858
formatting
markhuot Jun 11, 2018
2db5603
code cleanup
markhuot Jun 14, 2018
fa17081
moving events
markhuot Jun 14, 2018
cd7b156
use statement cleanuop
markhuot Jun 14, 2018
154487f
cleanup
markhuot Jun 14, 2018
aee5330
type hints
markhuot Jun 14, 2018
49acbd2
removing comment
markhuot Jun 14, 2018
b0506d4
cleanup
markhuot Jun 14, 2018
2a6cae1
token cleanup
markhuot Jun 14, 2018
e58790f
better service/component support
markhuot Jun 14, 2018
105b662
Merge remote-tracking branch 'origin/master' into user-tokens
markhuot Jun 14, 2018
1ec6e27
jwt expiration implmented
markhuot Jun 14, 2018
5a131fb
Merge branch 'master' into user-tokens
markhuot Jun 21, 2018
3ce1132
docblock
markhuot Jun 21, 2018
1ed1a61
less coupling and allows JWT to contain or not contain an `exp`
markhuot Jun 21, 2018
6a6e12f
Merge branch 'master' into user-tokens
markhuot Jul 13, 2018
b7e9590
fixes bad merge
markhuot Jul 13, 2018
89529e8
updated to send refreshed tokens with each request via Authorization …
markhuot Jul 18, 2018
974e10c
#89 updates header format
markhuot Jul 19, 2018
593fb19
Merge branch 'master' into user-tokens
markhuot Jul 27, 2018
4dd33c2
fixes a bug when entries are disabled
markhuot Jul 27, 2018
5dc48bd
hopefully more logical token querying
markhuot Jul 27, 2018
71a5b79
Added more permissions
Dec 11, 2018
85c655b
Added check for own or all types
Dec 11, 2018
d5986a4
Updated options to allow for mixed queries such as private entries co…
Dec 12, 2018
a9543fd
Added Access-Control-Expose-Headers
Dec 13, 2018
a85bd45
Add conditional to check if Group ID is int or not. If not int, try t…
Aug 9, 2019
d037e06
Update composer json
Aug 9, 2019
deed95b
Update composer.json
ashtonlance Aug 12, 2019
73ea4e7
Merge pull request #2 from u12206050/user-tokens
paradigm314 Apr 17, 2020
c225414
Merge branch 'master' of github.com:wintheday/craftql into user-tokens
paradigm314 Apr 17, 2020
1f1b293
Use getInstance() instead of instance variable
paradigm314 Apr 18, 2020
86ef55e
Remove unnecessary delay and use consistent error message for invalid…
paradigm314 Apr 18, 2020
9acce95
User Permissions
paradigm314 Apr 18, 2020
108af3e
Fix Syntax Errors, Add Dev Linting
paradigm314 Apr 21, 2020
c801b48
Adjust user mutation permissions
paradigm314 Apr 21, 2020
4ec76a6
Ignore Undefined Index errors when loading token scopes
paradigm314 Apr 21, 2020
592c83f
Fix issue checking token for mutations
paradigm314 Apr 21, 2020
4e9c951
Properly set registration permission on anonymous requests
paradigm314 Apr 21, 2020
7db90d5
Check correct mutation permission regex
paradigm314 Apr 24, 2020
d34a3f4
Unset password input after applying it
paradigm314 Apr 24, 2020
bf5330c
Support Returning JWT token on user when registering them
paradigm314 Apr 25, 2020
81b7814
Add Token to User type
paradigm314 Apr 25, 2020
49bc637
Disable Token setting to find bug
paradigm314 May 15, 2020
c8ea934
Merge pull request #4 from ashtonlance/master
paradigm314 May 22, 2020
6426f90
Apply Field Callbacks in User Mutation
paradigm314 May 22, 2020
d2c7b83
Add User Delete Mutation
paradigm314 Aug 4, 2020
9932f03
Update graphql-php
paradigm314 Aug 5, 2020
9bda3cd
Revert graphql-php version
paradigm314 Aug 5, 2020
f2e5979
Allow Base64 User Photo Upload
paradigm314 Aug 11, 2020
6c4d79d
Fix User Photo argument naming
paradigm314 Aug 11, 2020
8745f9c
Remove Duplicate filename as tempFilePath generates a name for us.
paradigm314 Aug 12, 2020
06d715a
Fix validation and add user photo filename
paradigm314 Aug 12, 2020
12d46d2
Allow for photo deletion if null is passed.
paradigm314 Aug 12, 2020
8e1efbc
Unset photo when deleting
paradigm314 Aug 12, 2020
dc774f0
Check for photoId before deleting
paradigm314 Sep 8, 2020
0e34d34
Allow for not including the photo arg
paradigm314 Sep 11, 2020
27688c1
Use UUID to ensure unique avatar file names
paradigm314 Sep 11, 2020
732acf6
Refresh Refactor
paradigm314 Nov 8, 2020
97c52c7
Handle missing values for refresh token checks and generation
paradigm314 Nov 10, 2020
a414f8c
Return tokenData from refresh decode
paradigm314 Nov 10, 2020
711c3b8
feat: Support triggering reset password email
paradigm314 Jan 13, 2023
25f3ca5
fix(resetPassword): Invoke resolve on correct object
paradigm314 Jan 13, 2023
b97b68d
fix(resetPassword): Add a PasswordReset type
paradigm314 Jan 13, 2023
6f11c52
feat: Craft 3.6 Compatiblity
Aug 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
vendor
.DS_Store
.idea
.envrc
.tool-versions
1 change: 1 addition & 0 deletions .phplint-cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"Directives\/Date.php":"baeb2a9b2cfd54bac865275a21ffb2a4","migrations\/Install.php":"bdac5ceaf75628d94501436a7a9d99e1","migrations\/m170804_170613_add_scopes.php":"e0a91f086742015e4be16ce9dcd3d0cc","Types\/GlobalsSet.php":"be4aa61174b94342963334ae6dcd3a0f","Types\/TagEdge.php":"3dd152aceb896a9a1364edc39dd6010d","Types\/PageInfo.php":"cd3c234439e7b6227bd9a23da4197b20","Types\/Category.php":"261a780b751773a610f2d45fe1b7eb38","Types\/Mutation.php":"807c0e78a3b3b633e154307e18e77e7f","Types\/Timestamp.php":"7b992fb55cd6254eda53af019e050fd0","Types\/Volume.php":"768da11619e56ee5ce73ddb68ffc1f35","Types\/OptionFieldDataOptions.php":"81791e88bc1e322dc63714b11129e54d","Types\/VolumeInterface.php":"60ca277fa635d1318af32a76163ebf7b","Types\/EntryInterface.php":"f7310b403be156bfad63cfa5c226fad9","Types\/Authorize.php":"65c6030498077e2057e7576f056da77f","Types\/TagInterface.php":"a62d6fb8956143ef74c9c73fc2f05754","Types\/CategoryInterface.php":"e3fb0f08b2957c077b0454c6f1bcb1e0","Types\/EntryDraftConnection.php":"17511256eed20693ca8748d5f6628754","Types\/Tag.php":"832d7d88d29ee1dcc730b0a6f530b0f2","Types\/CategoryGroup.php":"60a4bc0603220428d1fdc246d51388bf","Types\/User.php":"9185044a1e80cda3a968819609b997c1","Types\/OptionFieldData.php":"e70fbf0132072e6e81961425b42ae893","Types\/Field.php":"121ef00f689e78e677686f38a3f26f59","Types\/CategoryEdge.php":"e3f789e5035e9b25893a442f2ab1e662","Types\/Section.php":"7766719b9e4436766e9cf013dd239ef9","Types\/Entry.php":"221ed92de5fd2afce1018b266fec0aa4","Types\/MultiOptionFieldData.php":"05501b0b9b01367150b2d8e15ceaf408","Types\/TagGroup.php":"3a6158e2f9465644f6deacee9bb47b57","Types\/EntryDraftInfo.php":"4e7cfa4a7493aedbc27a263998062056","Types\/SectionSiteSettings.php":"015d796a7d587dd71fa6623eb3598472","Types\/Globals.php":"ea1b57496e3e792b9b0fbed78c98f375","Types\/EntryDraftEdge.php":"1b1b9dd062848e1069b068de95f7ea53","Types\/EntryEdge.php":"6a793e416b033131d7aa46cee5af1154","Types\/CategoryConnection.php":"0b6f59bff6afcd66f077f3e8f1813667","Types\/Query.php":"faac3808e5328f7e4c49ee60d262fa2e","Types\/ElementInterface.php":"0af961a0995acfc44bbadce33272b24d","Types\/VolumeFolder.php":"b788b6f40e44159215ec33de813d495d","Types\/EntryType.php":"95da0ddae6c0f3998597a4369e16e4fa","Types\/TagConnection.php":"ade5318cbd441ba3445c206934d734a4","Types\/EntryConnection.php":"bb8ffb6e3691ba777c71f93420adb5ea","Types\/Site.php":"21728601850dbc401d8542a9edfad99e","GraphiQLAssetBundle.php":"1ee7ac5d3412ede48f2f762cc1b60090","Builders\/HasResolveAttribute.php":"0c9edfeacdbebe939f66cd4972227edf","Builders\/EnumObject.php":"c7ae8a37a38c5d51b6d071714f6bad1f","Builders\/ContentField.php":"a2f7b6c203cc5494a2e433ffd54f70fc","Builders\/Argument.php":"bc58e7f1c40aea08a1ed83b8993c230b","Builders\/HasDescriptionAttribute.php":"9b89956b611645be16f4ae227947ea2e","Builders\/InterfaceBuilder.php":"582550f35748c01ae65fb83e1051ac71","Builders\/InputSchema.php":"9bd36aaef58410736bb8277945d44eb5","Builders\/HasIsListAttribute.php":"008233ae4cac7de01e09c6db88f179c9","Builders\/HasOnSaveAttribute.php":"912eecf6ae28be322f7c8a0049173075","Builders\/Field.php":"e3d8e16ba397f070efeb9e9f86c9c567","Builders\/HasDeprecationReasonAttribute.php":"c9259e7346df24aa34489fb453e4ae5a","Builders\/HasArgumentsAttribute.php":"1e30f5e96031d2275ad2906b60d8cf7c","Builders\/Date.php":"f2e6df9547a2ebe437b88c20b716fc67","Builders\/HasNonNullAttribute.php":"6fb719c199c061c9da19880d0e5b6462","Builders\/Schema.php":"db7862c996dd5c3e8cb16592ac49de07","Builders\/HasTypeAttribute.php":"2dc892a2fa13d2d6f45125be8a52f32c","Builders\/BaseBuilder.php":"b9833341e12d172ccfbbfa0bd7377ec1","Builders\/Union.php":"0bc1757f662471b987a2667a3fe96737","Builders\/EnumField.php":"1f578407e4a5a8c9017e2f3086d8cde0","TypeModels\/PageInfo.php":"357cf86c4725878e75e75bf4f0533f7f","events.php":"7a1ee57998d4ad2803cfa4bcb523e2ef","Repositories\/Volumes.php":"962b3279ec5c231d1c1f5c09c0c20ab6","Repositories\/CategoryGroup.php":"ce6e1bd189557a4b6eccf29ec175e8b6","Repositories\/Section.php":"233795aeb2c448a64f2932a2f905095c","Repositories\/TagGroup.php":"90abbe425aaa627edea7599b958c583b","Repositories\/Globals.php":"f33089c03a539d2388302cc12edb1f60","Repositories\/EntryType.php":"d361108742c657dbc6a3070cbb1a12ad","Models\/Settings.php":"8f90a36e3a144c3952fd65d9d2682852","Models\/Token.php":"51093c1690d879a1962756da3cf6b874","CraftQL.php":"d51ea33f98050d33db8d1625519dd0d2","Request.php":"e3d6c81e2543c9a6799a381167226b7c","Behaviors\/FieldBehavior.php":"5ae6bff9597550fb5e8ee1c8abfb2aed","Behaviors\/SchemaBehavior.php":"5b46ff848f03b0c60413dcd4057583c1","Factories\/Volume.php":"4818db3c3f7d4e5227a34aaea66a5eff","Factories\/CategoryGroup.php":"e52b302a120c7fde80af3ce76ba13ece","Factories\/Section.php":"1a4675b195302743c7472c02ee9142c9","Factories\/BaseFactory.php":"7f23db8c96c5f369a70259f095e8e485","Factories\/TagGroup.php":"b7cb9980d92a83a710d7fb62f91968e7","Factories\/Globals.php":"b1d0c6c6be79df67981e4004548747af","Factories\/EntryType.php":"8978798c65bcb45a5f4c9a5e1066202c","Factories\/DraftEntryType.php":"a7d18b520c59d47277ee1bfd1c2e49ea","Events\/AlterQuerySchema.php":"ec3ff837e159e7bc60aeaf5cd7cfae7b","Events\/GetFieldSchema.php":"1fea4e43df488f7531b596bbdb188041","Events\/AlterSchemaFields.php":"9eef06015d13cc67a98233c762892f42","Controllers\/ApiController.php":"61ed653a5c44b902218aaf608aafeaee","Controllers\/CpController.php":"a754745cbda87e4dfed9a4e299e3a49e","Listeners\/GetSuperTableFieldSchema.php":"5cf90f651dcd75d2b80f2ca2d732510f","Listeners\/GetSelectMultipleFieldSchema.php":"4994a19db85021117db39d7e6e037f91","Listeners\/GetMatrixFieldSchema.php":"1599b300042097bd6d1f611707c60c5f","Listeners\/GetColorFieldSchema.php":"32b71a617926a0b8c01e02e94ee5b4b9","Listeners\/GetVideosFieldSchema.php":"13c49543a684598b3e34856ae24fa596","Listeners\/GetUsersFieldSchema.php":"df83e779effeca8c7896f253620eb3ab","Listeners\/GetUserPermissions.php":"a24d43cd3f763d5952d7dad77493ea2a","Listeners\/GetTableFieldSchema.php":"c411a6935bb97e480c0e1ce4319fd116","Listeners\/GetSelectOneFieldSchema.php":"f5b9f540afa8d8d0e4e3ec7251fc1680","Listeners\/GetDateFieldSchema.php":"0432c0c39654792471adc649b04750a2","Listeners\/GetNumberFieldSchema.php":"42c123b3a57387fbb87cbc0b29a07a11","Listeners\/GetDefaultFieldSchema.php":"793d5046942da5489ace073e670acad2","Listeners\/GetEntriesFieldSchema.php":"e352c02ad6c20070912c3fd52c1a8f6a","Listeners\/GetPositionSelectFieldSchema.php":"0298329ecf341b0842aef6f8d3bcab36","Listeners\/GetCategoriesFieldSchema.php":"629016929f40892d3ab7c74920a3ab56","Listeners\/GetLightswitchFieldSchema.php":"f03a65ccf6b133aa4041d74e2eb9761c","Listeners\/GetTagsFieldSchema.php":"1074ce6430434c1838631abb16d0a37d","Listeners\/GetAssetsFieldSchema.php":"27d706390b93d1477aa696f7f9e59400","Listeners\/GetRedactorFieldSchema.php":"33749d16f29388490cd4e4bf900f16fc","Helpers\/StringHelper.php":"dc934b6491437c8aa184ba8c00aab3d9","Services\/GraphQLService.php":"9f9125083f8422188efec74e4c6a9d07","Services\/FieldService.php":"c1a98d2549367c1cba4a705681a8e0db","FieldBehaviors\/EntryMutationArguments.php":"12438eca9b47c463b9d32941f349ab87","FieldBehaviors\/AssetQueryArguments.php":"3f9a989390e8cb3197ba89676f67f80b","FieldBehaviors\/AssetTransformArguments.php":"4066e61688429007eaab847cf6ce822a","FieldBehaviors\/EntryQueryArguments.php":"3c29942eca383d86fc7392e7bc7844b0","FieldBehaviors\/TagQueryArguments.php":"de68bc8cbffe598488d8648155f43764","FieldBehaviors\/UserQueryArguments.php":"bf4b14b49c56679f6b52a7a52686a21a","FieldBehaviors\/RelatedEntriesField.php":"2f1b158a2ca5d1dd3fc2f26b4856ef0a","FieldBehaviors\/RelatedCategoriesField.php":"e89b1620e5d52963bb46a93f293cf504","FieldBehaviors\/CategoryQueryArguments.php":"d0ebed0a52831e2c265f767777943d2d","Console\/ToolsController.php":"3eb5de3165031f6ce817b21f4f387ba6","Services\/JWTService.php":"f16d99895e5e1e7967c7721acc68de47"}
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM php:7.4-cli

# Update Apt
RUN apt update && apt -y upgrade

# Install Tools
RUN apt install wget

# Install PHP Extensions
RUN apt-get install -y \
libzip-dev \
zip \
&& docker-php-ext-install zip

# Install Composer
RUN EXPECTED_SIGNATURE=$(wget -q -O - https://composer.github.io/installer.sig) \
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \
&& php -r "if (hash_file('SHA384', 'composer-setup.php') === '$EXPECTED_SIGNATURE') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" \
&& php composer-setup.php --install-dir=/usr/bin --filename=composer \
&& php -r "unlink('composer-setup.php');"


COPY / /

CMD ["composer"]
22 changes: 18 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@
"craft-plugin"
],
"require": {
"craftcms/cms": "^3.2.0",
"webonyx/graphql-php": "^0.12.0",
"react/http": "^0.7"
"craftcms/cms": "^3.6.0",
"webonyx/graphql-php": "^14.4.1",
"react/http": "^0.7",
"firebase/php-jwt": "^5.0.0"
},
"authors": [
{
Expand All @@ -29,6 +30,19 @@
"handle": "craftql",
"developer": "Mark Huot",
"developerUrl": "https://www.github.com/markhuot",
"class": "markhuot\\CraftQL\\CraftQL"
"class": "markhuot\\CraftQL\\CraftQL",
"components": {
"graphQl": "markhuot\\CraftQL\\Services\\GraphQLService",
"jwt": "markhuot\\CraftQL\\Services\\JWTService"
}
},
"require-dev": {
"overtrue/phplint": "^2.0"
},
"config": {
"allow-plugins": {
"yiisoft/yii2-composer": true,
"craftcms/plugin-installer": true
}
}
}
Loading