From ebd11c831f03202f0eea6d888f9440da8df45422 Mon Sep 17 00:00:00 2001 From: Stuart Clark Date: Fri, 5 Aug 2022 00:04:36 +0000 Subject: [PATCH] feat(#458): add auth modules and configuration --- .gitpod.yml | 5 +- .gitpod/scripts/env-setup.sh | 4 + docs/drupal/.ddev/commands/web/drupal-install | 1 + docs/drupal/.ddev/commands/web/gitpod-config | 16 + docs/drupal/.ddev/docker-compose.env.yaml | 8 + docs/drupal/composer.json | 1 + docs/drupal/composer.lock | 728 +++++++++++++++++- docs/drupal/config/sync/core.extension.yml | 6 +- ...oauth.oauth2_token.bundle.access_token.yml | 10 + ...le_oauth.oauth2_token.bundle.auth_code.yml | 10 + ...auth.oauth2_token.bundle.refresh_token.yml | 10 + .../config/sync/simple_oauth.settings.yml | 11 + ....1a6b8816-26de-4b70-bcdf-919600542f03.json | 62 ++ docs/drupal/content/meta/index.json | 5 +- docs/drupal/keys/private.key | 52 ++ docs/drupal/keys/public.key | 14 + 16 files changed, 938 insertions(+), 5 deletions(-) create mode 100755 .gitpod/scripts/env-setup.sh create mode 100755 docs/drupal/.ddev/commands/web/gitpod-config create mode 100644 docs/drupal/.ddev/docker-compose.env.yaml create mode 100644 docs/drupal/config/sync/simple_oauth.oauth2_token.bundle.access_token.yml create mode 100644 docs/drupal/config/sync/simple_oauth.oauth2_token.bundle.auth_code.yml create mode 100644 docs/drupal/config/sync/simple_oauth.oauth2_token.bundle.refresh_token.yml create mode 100644 docs/drupal/config/sync/simple_oauth.settings.yml create mode 100644 docs/drupal/content/consumer.1a6b8816-26de-4b70-bcdf-919600542f03.json create mode 100644 docs/drupal/keys/private.key create mode 100644 docs/drupal/keys/public.key diff --git a/.gitpod.yml b/.gitpod.yml index 4672810e0..a7d23d33c 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -19,8 +19,11 @@ tasks: cd $GITPOD_REPO_ROOT/docs/nuxt && yarn cd $GITPOD_REPO_ROOT && yarn build:docs command: | + # Setup Gitpod .env + $GITPOD_REPO_ROOT/.gitpod/scripts/env-setup.sh + # Start Drupal - cd $GITPOD_REPO_ROOT/docs/drupal && ddev start -y && ddev drush uli + cd $GITPOD_REPO_ROOT/docs/drupal && ddev start -y && ddev gitpod-config && ddev drush uli # Display welcome message cd $GITPOD_REPO_ROOT && cat .gitpod/WELCOME.md diff --git a/.gitpod/scripts/env-setup.sh b/.gitpod/scripts/env-setup.sh new file mode 100755 index 000000000..09450f3b1 --- /dev/null +++ b/.gitpod/scripts/env-setup.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -eu -o pipefail + +echo -en "OAUTH_CALLBACK=https://3000-${GITPOD_WORKSPACE_ID}.${GITPOD_WORKSPACE_CLUSTER_HOST}/callback" > docs/.env diff --git a/docs/drupal/.ddev/commands/web/drupal-install b/docs/drupal/.ddev/commands/web/drupal-install index c41c83a82..9d51c2716 100755 --- a/docs/drupal/.ddev/commands/web/drupal-install +++ b/docs/drupal/.ddev/commands/web/drupal-install @@ -6,3 +6,4 @@ composer install drush -y tome:install +drush cache:rebuild diff --git a/docs/drupal/.ddev/commands/web/gitpod-config b/docs/drupal/.ddev/commands/web/gitpod-config new file mode 100755 index 000000000..cb1ec2620 --- /dev/null +++ b/docs/drupal/.ddev/commands/web/gitpod-config @@ -0,0 +1,16 @@ +#!/bin/bash + +## Description: Update Gitpod configuration in Drupal +## Usage: gitpod-config +## Example: "ddev gitpod-config" + +# Update the Consumer redirect URL. +drush php-eval ' +$consumer = \Drupal::service("entity.repository")->loadEntityByUuid("consumer", "1a6b8816-26de-4b70-bcdf-919600542f03"); +$consumer->redirect = getenv("OAUTH_CALLBACK") ?: "http://localhost:3000/callback"; +# var_dump($consumer->redirect->value); +$consumer->save(); +' + +# Rebuild cache. +drush cache:rebuild diff --git a/docs/drupal/.ddev/docker-compose.env.yaml b/docs/drupal/.ddev/docker-compose.env.yaml new file mode 100644 index 000000000..58a74b641 --- /dev/null +++ b/docs/drupal/.ddev/docker-compose.env.yaml @@ -0,0 +1,8 @@ +version: '3.6' + +services: + web: + env_file: + - "$PWD/../.env" + volumes: + - "$PWD/../.env:/var/www/html/.env" diff --git a/docs/drupal/composer.json b/docs/drupal/composer.json index 3abfaa25d..0aed4aed4 100644 --- a/docs/drupal/composer.json +++ b/docs/drupal/composer.json @@ -24,6 +24,7 @@ "drupal/decoupled_router": "2.0.3", "drupal/druxt": "^1.1.1", "drupal/jsonapi_hypermedia": "^1.6", + "drupal/simple_oauth": "^5.2", "drupal/tome": "^1.6", "drush/drush": "^11.0" }, diff --git a/docs/drupal/composer.lock b/docs/drupal/composer.lock index cb1659d6e..1035b7323 100644 --- a/docs/drupal/composer.lock +++ b/docs/drupal/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "6ac31ae0944733c873b16a3e657d0ac2", + "content-hash": "790ceeab906f81711a7f7de8b299b13e", "packages": [ { "name": "asm89/stack-cors", @@ -951,6 +951,72 @@ }, "time": "2022-01-25T19:21:20+00:00" }, + { + "name": "defuse/php-encryption", + "version": "v2.3.1", + "source": { + "type": "git", + "url": "https://github.com/defuse/php-encryption.git", + "reference": "77880488b9954b7884c25555c2a0ea9e7053f9d2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/defuse/php-encryption/zipball/77880488b9954b7884c25555c2a0ea9e7053f9d2", + "reference": "77880488b9954b7884c25555c2a0ea9e7053f9d2", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "paragonie/random_compat": ">= 2", + "php": ">=5.6.0" + }, + "require-dev": { + "phpunit/phpunit": "^4|^5|^6|^7|^8|^9" + }, + "bin": [ + "bin/generate-defuse-key" + ], + "type": "library", + "autoload": { + "psr-4": { + "Defuse\\Crypto\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Taylor Hornby", + "email": "taylor@defuse.ca", + "homepage": "https://defuse.ca/" + }, + { + "name": "Scott Arciszewski", + "email": "info@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "Secure PHP Encryption Library", + "keywords": [ + "aes", + "authenticated encryption", + "cipher", + "crypto", + "cryptography", + "encrypt", + "encryption", + "openssl", + "security", + "symmetric key cryptography" + ], + "support": { + "issues": "https://github.com/defuse/php-encryption/issues", + "source": "https://github.com/defuse/php-encryption/tree/v2.3.1" + }, + "time": "2021-04-09T23:57:26+00:00" + }, { "name": "dflydev/dot-access-data", "version": "v3.0.1", @@ -1297,6 +1363,54 @@ }, "time": "2022-02-18T06:20:45+00:00" }, + { + "name": "drupal/consumers", + "version": "1.13.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/consumers.git", + "reference": "8.x-1.13" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/consumers-8.x-1.13.zip", + "reference": "8.x-1.13", + "shasum": "6cb3a738e09698c539c0cf77c651fe4384eb359f" + }, + "require": { + "drupal/core": "^8 || ^9 || ^10" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "8.x-1.13", + "datestamp": "1657809825", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0-or-later" + ], + "authors": [ + { + "name": "e0ipso", + "homepage": "https://www.drupal.org/user/550110" + }, + { + "name": "eojthebrave", + "homepage": "https://www.drupal.org/user/79230" + } + ], + "description": "Declare all the consumers of your API", + "homepage": "https://www.drupal.org/project/consumers", + "support": { + "source": "https://git.drupalcode.org/project/consumers" + } + }, { "name": "drupal/core", "version": "9.3.9", @@ -2069,6 +2183,76 @@ "source": "https://git.drupalcode.org/project/jsonapi_views" } }, + { + "name": "drupal/simple_oauth", + "version": "5.2.0", + "source": { + "type": "git", + "url": "https://git.drupalcode.org/project/simple_oauth.git", + "reference": "5.2.0" + }, + "dist": { + "type": "zip", + "url": "https://ftp.drupal.org/files/projects/simple_oauth-5.2.0.zip", + "reference": "5.2.0", + "shasum": "3d2b0f38284190a59e4ac99d6f5d4af424c4d19f" + }, + "require": { + "drupal/consumers": "^1.2", + "drupal/core": "^8 || ^9", + "lcobucci/jwt": "^4", + "league/oauth2-server": "^8.3", + "php": ">=7.4", + "steverhoades/oauth2-openid-connect-server": "^2.4" + }, + "require-dev": { + "phpspec/prophecy-phpunit": "^2" + }, + "type": "drupal-module", + "extra": { + "drupal": { + "version": "5.2.0", + "datestamp": "1641403293", + "security-coverage": { + "status": "covered", + "message": "Covered by Drupal's security advisory policy" + } + }, + "drush": { + "services": { + "drush.services.yml": "^9" + } + } + }, + "notification-url": "https://packages.drupal.org/8/downloads", + "license": [ + "GPL-2.0+" + ], + "authors": [ + { + "name": "Mateu Aguiló Bosch", + "homepage": "https://www.drupal.org/user/2801849", + "email": "mateu.aguilo.bosch@gmail.com" + }, + { + "name": "bradjones1", + "homepage": "https://www.drupal.org/user/405824" + }, + { + "name": "e0ipso", + "homepage": "https://www.drupal.org/user/550110" + }, + { + "name": "pcambra", + "homepage": "https://www.drupal.org/user/122101" + } + ], + "description": "The Simple OAuth module for Drupal", + "homepage": "https://www.drupal.org/project/simple_oauth", + "support": { + "source": "https://git.drupalcode.org/project/simple_oauth" + } + }, { "name": "drupal/tome", "version": "1.6.0", @@ -3138,6 +3322,141 @@ ], "time": "2021-11-10T11:33:52+00:00" }, + { + "name": "lcobucci/clock", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/lcobucci/clock.git", + "reference": "353d83fe2e6ae95745b16b3d911813df6a05bfb3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lcobucci/clock/zipball/353d83fe2e6ae95745b16b3d911813df6a05bfb3", + "reference": "353d83fe2e6ae95745b16b3d911813df6a05bfb3", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "infection/infection": "^0.17", + "lcobucci/coding-standard": "^6.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/php-code-coverage": "9.1.4", + "phpunit/phpunit": "9.3.7" + }, + "type": "library", + "autoload": { + "psr-4": { + "Lcobucci\\Clock\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Luís Cobucci", + "email": "lcobucci@gmail.com" + } + ], + "description": "Yet another clock abstraction", + "support": { + "issues": "https://github.com/lcobucci/clock/issues", + "source": "https://github.com/lcobucci/clock/tree/2.0.x" + }, + "funding": [ + { + "url": "https://github.com/lcobucci", + "type": "github" + }, + { + "url": "https://www.patreon.com/lcobucci", + "type": "patreon" + } + ], + "time": "2020-08-27T18:56:02+00:00" + }, + { + "name": "lcobucci/jwt", + "version": "4.1.5", + "source": { + "type": "git", + "url": "https://github.com/lcobucci/jwt.git", + "reference": "fe2d89f2eaa7087af4aa166c6f480ef04e000582" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/fe2d89f2eaa7087af4aa166c6f480ef04e000582", + "reference": "fe2d89f2eaa7087af4aa166c6f480ef04e000582", + "shasum": "" + }, + "require": { + "ext-hash": "*", + "ext-json": "*", + "ext-mbstring": "*", + "ext-openssl": "*", + "ext-sodium": "*", + "lcobucci/clock": "^2.0", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "infection/infection": "^0.21", + "lcobucci/coding-standard": "^6.0", + "mikey179/vfsstream": "^1.6.7", + "phpbench/phpbench": "^1.0", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12", + "phpstan/phpstan-deprecation-rules": "^0.12", + "phpstan/phpstan-phpunit": "^0.12", + "phpstan/phpstan-strict-rules": "^0.12", + "phpunit/php-invoker": "^3.1", + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Lcobucci\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Luís Cobucci", + "email": "lcobucci@gmail.com", + "role": "Developer" + } + ], + "description": "A simple library to work with JSON Web Token and JSON Web Signature", + "keywords": [ + "JWS", + "jwt" + ], + "support": { + "issues": "https://github.com/lcobucci/jwt/issues", + "source": "https://github.com/lcobucci/jwt/tree/4.1.5" + }, + "funding": [ + { + "url": "https://github.com/lcobucci", + "type": "github" + }, + { + "url": "https://www.patreon.com/lcobucci", + "type": "patreon" + } + ], + "time": "2021-09-28T19:34:56+00:00" + }, { "name": "league/container", "version": "4.2.0", @@ -3220,6 +3539,318 @@ ], "time": "2021-11-16T10:29:06+00:00" }, + { + "name": "league/event", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/event.git", + "reference": "d2cc124cf9a3fab2bb4ff963307f60361ce4d119" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/event/zipball/d2cc124cf9a3fab2bb4ff963307f60361ce4d119", + "reference": "d2cc124cf9a3fab2bb4ff963307f60361ce4d119", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "henrikbjorn/phpspec-code-coverage": "~1.0.1", + "phpspec/phpspec": "^2.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.2-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Event\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Frank de Jonge", + "email": "info@frenky.net" + } + ], + "description": "Event package", + "keywords": [ + "emitter", + "event", + "listener" + ], + "support": { + "issues": "https://github.com/thephpleague/event/issues", + "source": "https://github.com/thephpleague/event/tree/master" + }, + "time": "2018-11-26T11:52:41+00:00" + }, + { + "name": "league/oauth2-server", + "version": "8.3.5", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/oauth2-server.git", + "reference": "7aeb7c42b463b1a6fe4d084d3145e2fa22436876" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/7aeb7c42b463b1a6fe4d084d3145e2fa22436876", + "reference": "7aeb7c42b463b1a6fe4d084d3145e2fa22436876", + "shasum": "" + }, + "require": { + "defuse/php-encryption": "^2.2.1", + "ext-json": "*", + "ext-openssl": "*", + "lcobucci/jwt": "^3.4.6 || ^4.0.4", + "league/event": "^2.2", + "league/uri": "^6.4", + "php": "^7.2 || ^8.0", + "psr/http-message": "^1.0.1" + }, + "replace": { + "league/oauth2server": "*", + "lncd/oauth2": "*" + }, + "require-dev": { + "laminas/laminas-diactoros": "^2.4.1", + "phpstan/phpstan": "^0.12.57", + "phpstan/phpstan-phpunit": "^0.12.16", + "phpunit/phpunit": "^8.5.13", + "roave/security-advisories": "dev-master" + }, + "type": "library", + "autoload": { + "psr-4": { + "League\\OAuth2\\Server\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alex Bilbie", + "email": "hello@alexbilbie.com", + "homepage": "http://www.alexbilbie.com", + "role": "Developer" + }, + { + "name": "Andy Millington", + "email": "andrew@noexceptions.io", + "homepage": "https://www.noexceptions.io", + "role": "Developer" + } + ], + "description": "A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.", + "homepage": "https://oauth2.thephpleague.com/", + "keywords": [ + "Authentication", + "api", + "auth", + "authorisation", + "authorization", + "oauth", + "oauth 2", + "oauth 2.0", + "oauth2", + "protect", + "resource", + "secure", + "server" + ], + "support": { + "issues": "https://github.com/thephpleague/oauth2-server/issues", + "source": "https://github.com/thephpleague/oauth2-server/tree/8.3.5" + }, + "funding": [ + { + "url": "https://github.com/sephster", + "type": "github" + } + ], + "time": "2022-05-03T21:21:28+00:00" + }, + { + "name": "league/uri", + "version": "6.7.1", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri.git", + "reference": "2d7c87a0860f3126a39f44a8a9bf2fed402dcfea" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri/zipball/2d7c87a0860f3126a39f44a8a9bf2fed402dcfea", + "reference": "2d7c87a0860f3126a39f44a8a9bf2fed402dcfea", + "shasum": "" + }, + "require": { + "ext-json": "*", + "league/uri-interfaces": "^2.3", + "php": "^7.4 || ^8.0", + "psr/http-message": "^1.0" + }, + "conflict": { + "league/uri-schemes": "^1.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^v3.3.2", + "nyholm/psr7": "^1.5", + "php-http/psr7-integration-tests": "^1.1", + "phpstan/phpstan": "^1.2.0", + "phpstan/phpstan-deprecation-rules": "^1.0", + "phpstan/phpstan-phpunit": "^1.0.0", + "phpstan/phpstan-strict-rules": "^1.1.0", + "phpunit/phpunit": "^9.5.10", + "psr/http-factory": "^1.0" + }, + "suggest": { + "ext-fileinfo": "Needed to create Data URI from a filepath", + "ext-intl": "Needed to improve host validation", + "league/uri-components": "Needed to easily manipulate URI objects", + "psr/http-factory": "Needed to use the URI factory" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "URI manipulation library", + "homepage": "https://uri.thephpleague.com", + "keywords": [ + "data-uri", + "file-uri", + "ftp", + "hostname", + "http", + "https", + "middleware", + "parse_str", + "parse_url", + "psr-7", + "query-string", + "querystring", + "rfc3986", + "rfc3987", + "rfc6570", + "uri", + "uri-template", + "url", + "ws" + ], + "support": { + "docs": "https://uri.thephpleague.com", + "forum": "https://thephpleague.slack.com", + "issues": "https://github.com/thephpleague/uri/issues", + "source": "https://github.com/thephpleague/uri/tree/6.7.1" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2022-06-29T09:48:18+00:00" + }, + { + "name": "league/uri-interfaces", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/thephpleague/uri-interfaces.git", + "reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/thephpleague/uri-interfaces/zipball/00e7e2943f76d8cb50c7dfdc2f6dee356e15e383", + "reference": "00e7e2943f76d8cb50c7dfdc2f6dee356e15e383", + "shasum": "" + }, + "require": { + "ext-json": "*", + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^2.19", + "phpstan/phpstan": "^0.12.90", + "phpstan/phpstan-phpunit": "^0.12.19", + "phpstan/phpstan-strict-rules": "^0.12.9", + "phpunit/phpunit": "^8.5.15 || ^9.5" + }, + "suggest": { + "ext-intl": "to use the IDNA feature", + "symfony/intl": "to use the IDNA feature via Symfony Polyfill" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "League\\Uri\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ignace Nyamagana Butera", + "email": "nyamsprod@gmail.com", + "homepage": "https://nyamsprod.com" + } + ], + "description": "Common interface for URI representation", + "homepage": "http://github.com/thephpleague/uri-interfaces", + "keywords": [ + "rfc3986", + "rfc3987", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/thephpleague/uri-interfaces/issues", + "source": "https://github.com/thephpleague/uri-interfaces/tree/2.3.0" + }, + "funding": [ + { + "url": "https://github.com/sponsors/nyamsprod", + "type": "github" + } + ], + "time": "2021-06-28T04:27:21+00:00" + }, { "name": "masterminds/html5", "version": "2.7.5", @@ -3345,6 +3976,56 @@ }, "time": "2021-11-30T19:35:32+00:00" }, + { + "name": "paragonie/random_compat", + "version": "v9.99.100", + "source": { + "type": "git", + "url": "https://github.com/paragonie/random_compat.git", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a", + "reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a", + "shasum": "" + }, + "require": { + "php": ">= 7" + }, + "require-dev": { + "phpunit/phpunit": "4.*|5.*", + "vimeo/psalm": "^1" + }, + "suggest": { + "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." + }, + "type": "library", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Paragon Initiative Enterprises", + "email": "security@paragonie.com", + "homepage": "https://paragonie.com" + } + ], + "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", + "keywords": [ + "csprng", + "polyfill", + "pseudorandom", + "random" + ], + "support": { + "email": "info@paragonie.com", + "issues": "https://github.com/paragonie/random_compat/issues", + "source": "https://github.com/paragonie/random_compat" + }, + "time": "2020-10-15T08:29:30+00:00" + }, { "name": "pear/archive_tar", "version": "1.4.14", @@ -4014,6 +4695,51 @@ }, "time": "2020-01-30T12:17:27+00:00" }, + { + "name": "steverhoades/oauth2-openid-connect-server", + "version": "v2.4.0", + "source": { + "type": "git", + "url": "https://github.com/steverhoades/oauth2-openid-connect-server.git", + "reference": "5f8f0246c1507dcc4d9dbcad32d651fe276c4409" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/steverhoades/oauth2-openid-connect-server/zipball/5f8f0246c1507dcc4d9dbcad32d651fe276c4409", + "reference": "5f8f0246c1507dcc4d9dbcad32d651fe276c4409", + "shasum": "" + }, + "require": { + "lcobucci/jwt": "4.1.5", + "league/oauth2-server": "^5.1|^6.0|^7.0|^8.0" + }, + "require-dev": { + "laminas/laminas-diactoros": "^1.3.2", + "phpunit/phpunit": "^5.0|^9.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "OpenIDConnectServer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Steve Rhoades", + "email": "sedonami@gmail.com" + } + ], + "description": "An OpenID Connect Server that sites on The PHP League's OAuth2 Server", + "support": { + "issues": "https://github.com/steverhoades/oauth2-openid-connect-server/issues", + "source": "https://github.com/steverhoades/oauth2-openid-connect-server/tree/v2.4.0" + }, + "time": "2021-10-28T13:38:28+00:00" + }, { "name": "symfony-cmf/routing", "version": "2.3.4", diff --git a/docs/drupal/config/sync/core.extension.yml b/docs/drupal/config/sync/core.extension.yml index 662ea6985..95cf9b214 100644 --- a/docs/drupal/config/sync/core.extension.yml +++ b/docs/drupal/config/sync/core.extension.yml @@ -1,3 +1,5 @@ +_core: + default_config_hash: R4IF-ClDHXxblLcG0L7MgsLvfBIMAvi_skumNFQwkDc module: automated_cron: 0 big_pipe: 0 @@ -8,6 +10,7 @@ module: color: 0 config: 0 config_translation: 0 + consumers: 0 contact: 0 content_moderation: 0 contextual: 0 @@ -49,6 +52,7 @@ module: search: 0 serialization: 0 shortcut: 0 + simple_oauth: 0 system: 0 taxonomy: 0 text: 0 @@ -69,5 +73,3 @@ theme: seven: 0 umami: 0 profile: demo_umami -_core: - default_config_hash: R4IF-ClDHXxblLcG0L7MgsLvfBIMAvi_skumNFQwkDc diff --git a/docs/drupal/config/sync/simple_oauth.oauth2_token.bundle.access_token.yml b/docs/drupal/config/sync/simple_oauth.oauth2_token.bundle.access_token.yml new file mode 100644 index 000000000..a2ce5b7a4 --- /dev/null +++ b/docs/drupal/config/sync/simple_oauth.oauth2_token.bundle.access_token.yml @@ -0,0 +1,10 @@ +uuid: 4850a157-fe6c-439d-bf1b-c449dd1ea545 +langcode: en +status: true +dependencies: { } +_core: + default_config_hash: z9ULI9nj9yt73YKI3ZE8v9yXhkVfvQsDJToEDzijcxY +id: access_token +label: 'Access Token' +description: 'The access token type.' +locked: true diff --git a/docs/drupal/config/sync/simple_oauth.oauth2_token.bundle.auth_code.yml b/docs/drupal/config/sync/simple_oauth.oauth2_token.bundle.auth_code.yml new file mode 100644 index 000000000..b01311fb9 --- /dev/null +++ b/docs/drupal/config/sync/simple_oauth.oauth2_token.bundle.auth_code.yml @@ -0,0 +1,10 @@ +uuid: 7c4ca2c0-f18a-4994-b6f9-3bde056c3af5 +langcode: en +status: true +dependencies: { } +_core: + default_config_hash: zYKaSl4QZrKMFj7aIhSGDRcBy4SoNjvY2EZlT7amrBk +id: auth_code +label: 'Auth code' +description: 'The auth code type.' +locked: true diff --git a/docs/drupal/config/sync/simple_oauth.oauth2_token.bundle.refresh_token.yml b/docs/drupal/config/sync/simple_oauth.oauth2_token.bundle.refresh_token.yml new file mode 100644 index 000000000..d55e7469e --- /dev/null +++ b/docs/drupal/config/sync/simple_oauth.oauth2_token.bundle.refresh_token.yml @@ -0,0 +1,10 @@ +uuid: 1e985ded-2165-4770-a214-6cc5b0cf1b1e +langcode: en +status: true +dependencies: { } +_core: + default_config_hash: YWMv3Do9fsPFhylyFkOwcqcFP4jSU6DLRootOlgrC0M +id: refresh_token +label: 'Refresh token' +description: 'The refresh token type.' +locked: true diff --git a/docs/drupal/config/sync/simple_oauth.settings.yml b/docs/drupal/config/sync/simple_oauth.settings.yml new file mode 100644 index 000000000..dfb3a3a2b --- /dev/null +++ b/docs/drupal/config/sync/simple_oauth.settings.yml @@ -0,0 +1,11 @@ +_core: + default_config_hash: KsPFWSp6mgXIQgjBJEShfKUGn6VLRlbpIJ2EysXvXWM +access_token_expiration: 300 +authorization_code_expiration: 300 +refresh_token_expiration: 1209600 +token_cron_batch_size: 0 +public_key: ../keys/public.key +private_key: ../keys/private.key +remember_clients: true +use_implicit: false +disable_openid_connect: false diff --git a/docs/drupal/content/consumer.1a6b8816-26de-4b70-bcdf-919600542f03.json b/docs/drupal/content/consumer.1a6b8816-26de-4b70-bcdf-919600542f03.json new file mode 100644 index 000000000..72e984ced --- /dev/null +++ b/docs/drupal/content/consumer.1a6b8816-26de-4b70-bcdf-919600542f03.json @@ -0,0 +1,62 @@ +{ + "uuid": [ + { + "value": "1a6b8816-26de-4b70-bcdf-919600542f03" + } + ], + "langcode": [ + { + "value": "en" + } + ], + "owner_id": [ + { + "target_type": "user", + "target_uuid": "1bc973b1-4bee-403f-8f76-52387c936207" + } + ], + "label": [ + { + "value": "Default Consumer" + } + ], + "description": [ + { + "value": "This is the default consumer. This was created programmatically when the Consumers module was first installed. Feel free to edit, or delete this." + } + ], + "image": [], + "third_party": [ + { + "value": true + } + ], + "is_default": [ + { + "value": true + } + ], + "default_langcode": [ + { + "value": true + } + ], + "secret": [], + "confidential": [ + { + "value": false + } + ], + "roles": [], + "redirect": [ + { + "value": "http:\/\/localhost:3000\/callback" + } + ], + "user_id": [], + "pkce": [ + { + "value": true + } + ] +} \ No newline at end of file diff --git a/docs/drupal/content/meta/index.json b/docs/drupal/content/meta/index.json index 41b79ca34..93c4bcac1 100644 --- a/docs/drupal/content/meta/index.json +++ b/docs/drupal/content/meta/index.json @@ -943,5 +943,8 @@ "user.8757c97f-7c55-4367-9237-72eb7eba10cd": [], "user.9037d975-34ff-4020-b8ff-18cf8715361a": [], "user.a80fc6ed-2669-4a56-88bf-1c9590437115": [], - "user.b8245fe3-b0e8-4300-89e9-733dc6c4a52b": [] + "user.b8245fe3-b0e8-4300-89e9-733dc6c4a52b": [], + "consumer.1a6b8816-26de-4b70-bcdf-919600542f03": [ + "user.1bc973b1-4bee-403f-8f76-52387c936207" + ] } \ No newline at end of file diff --git a/docs/drupal/keys/private.key b/docs/drupal/keys/private.key new file mode 100644 index 000000000..6c0ed79b2 --- /dev/null +++ b/docs/drupal/keys/private.key @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQDQeNdDKvzNpP7E +34E5yms/E33kBk9lOJmtwUDy8rnIj6W60Mb8KUqXK5YQS/red2+f9kGVHLNjtKq7 +D2qK3eJJBghZLpkVD1AeZKgT/3JIJZX7G7ZRchgW5ZvwalKl2CjBFaWWw7CAyT5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ll6xn/5Gdgf+h06tyDLihyWZkdgq1KhFgu8u/MPBJgbVfZKQol +SMqZ4xBb/c8bUYIb14riw3j6B+LMpEKe/nT8IrBAzXFd1S/1g3tgsWVYMBTrWIZA +IU6u+arsWV8KrLTE0GDLFSvNQnXbB7Au4/CoIwsCggEBAMLk1Zrj0XH9tqVvtRzX +LEG/ZMlXynzB4WShOcyLAc8fCuYufmhBtUWP6NikGozYZxSu2EkQc1EjbR8bnci/ +y64MsswzSpzQ4JCnDnxnRYuKc1qttovUzsf4FJGlakAyJRHBveVDJEZrvJKokYx6 +NXioHwtWT6rYeag66apyxvxEzs13CdDr9XVX0x6e6LBVnVVE+ABfNIuE70JgLYqJ +8MnzhY4Tsl/LAND9bDRIjpxH8dhJxrVJTyU32Zq5DUas6WMO8mvA055c8DYyxmUH +2B5zyeIyTn8z66taW7LgxOK2rTSu84/IAv3nWNkm+qWRSCRj6kIflkMyNjN2MbKN +fCUCggEBAOTHkTwZDHO+NDYMMzGxIoMnGtyQarz0+cOklPRNmyVm4/vC2WAp1E+o +va9poCp+itnfmgMeCQlQB2VX0adDsbXuM6juu6uTwyxJrFqRZo+ww8//TUXnrb43 +pYuDLZgwHyLpe8brioPBiN7wUO0XnEfo9xsEaytyxaf4qnBOTN8/EqEHEWxmWc3O +ZXbZGkx57m3cFYYcUtp4iizjgglTX/m2B71FrZ3cJR53CUDTOik2x7OsK9GB7pMY ++ahcyBJkW9D2B1ksa4PaZodkUjlGZnK4L2pQ1skfAEmiUiBgMWjPw7EbV5YxwqRZ +DFpyW0fNY0HsVbtHL9ixvh60U7EBdco= +-----END PRIVATE KEY----- diff --git a/docs/drupal/keys/public.key b/docs/drupal/keys/public.key new file mode 100644 index 000000000..b1a9820cf --- /dev/null +++ b/docs/drupal/keys/public.key @@ -0,0 +1,14 @@ +-----BEGIN PUBLIC KEY----- +MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0HjXQyr8zaT+xN+BOcpr +PxN95AZPZTiZrcFA8vK5yI+lutDG/ClKlyuWEEv63ndvn/ZBlRyzY7Squw9qit3i +SQYIWS6ZFQ9QHmSoE/9ySCWV+xu2UXIYFuWb8GpSpdgowRWllsOwgMk+U4kr6X0N +PQvex9Ebsdd7vsJGyZOSC/5adhbOoSlCRBxYqr0V2r2MHsaTmk8COOHTwEZN1Cwh +o3tHacn5w6gaagBAeS9g5zKjFdEk0V1ChPlJG2HRmdTjlZjZGUgqwu1YlyxwNPmH +vykD3/Pcu/YqGLRQQ0rwO3dK8Sl/jLrMXkECrWq1cXagh8F5Xur2zauKcnSwR4Cu +BPKBLELB64/IE7xTx8fvMRMet5U8N+FHG0L/Y+fx2+liD32/C2tznkjnp5LWbSiE +hra4InDq1fW5++30paFuyS0WJBBsCc+zvdbqSRIUWr/C+73UlpeQ48qvXkmo/uPi +ROGHPBHT92P/s8kILiQL5jphCMMV+utF8e5F63BgDT2kPE3/jSWk+5FXdu6IzyaY +sJNMsoBHbQ3jNDDwOGlBv+M1UaB2JwM06NPXsXemDxHy5qM+5x4mrkvyZBLNkXhi +P542DQTf81zlSnWX+dJK11r90Sjsgq4JF9sp5vpjW26/tKOY1VsvJRhQ0msQ9een +mRWsWZBVgITotrfyzvuObIcCAwEAAQ== +-----END PUBLIC KEY-----