diff --git a/.env b/.env index 8144ebc..f330891 100644 --- a/.env +++ b/.env @@ -4,6 +4,7 @@ APP_HOST=http://devkit-lti1p3.localhost APP_SECRET=3f33e29c19d9d24f0dccb90a3f84db04 APP_API_KEY=dcf8cb90ac4db043f33e29d2419d93f0 REDIS_CACHE_DSN=redis://devkit_lti1p3_redis:6379 +REDIS_CACHE_NAMESPACE=devkit REDIS_COMMANDER_URL=http://localhost:8081/ #TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 #TRUSTED_HOSTS='^(localhost|example\.com)$' diff --git a/CHANGELOG.md b/CHANGELOG.md index 52a50d2..20442bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG ========= +2.4.5 +----- +* Added `lineitem` to AGS claim +* Added Redis namespace support + 2.4.4 ----- * Updated `symfony/flex` in order to migrate from the outdated flex infrastructure diff --git a/cloudbuild.yaml b/cloudbuild.yaml new file mode 100644 index 0000000..0674d8c --- /dev/null +++ b/cloudbuild.yaml @@ -0,0 +1,24 @@ +steps: + - name: "gcr.io/cloud-builders/docker" + args: + [ + "build", + '--cache-from', + 'europe-west1-docker.pkg.dev/tao-artefacts/devkit/lti-devkit:develop', + "-t", + "europe-west1-docker.pkg.dev/tao-artefacts/devkit/lti-devkit:$COMMIT_SHA", + "-t", + "europe-west1-docker.pkg.dev/tao-artefacts/devkit/lti-devkit:${_BRANCH_NAME}", + -f, + "./docker/kube/Dockerfile", + ".", + ] +images: + - "europe-west1-docker.pkg.dev/tao-artefacts/devkit/lti-devkit:$COMMIT_SHA" + - 'europe-west1-docker.pkg.dev/tao-artefacts/devkit/lti-devkit:${_BRANCH_NAME}' + +substitutions: + _BRANCH_NAME: ${BRANCH_NAME//\//-} +options: + machineType: E2_HIGHCPU_32 + dynamic_substitutions: true \ No newline at end of file diff --git a/config/devkit/claims.yaml b/config/devkit/claims.yaml index 787d457..c4399d0 100644 --- a/config/devkit/claims.yaml +++ b/config/devkit/claims.yaml @@ -9,6 +9,7 @@ parameters: 'https://purl.imsglobal.org/spec/lti-ags/scope/score' ] lineitems: '%application_host%/platform/service/ags/default/lineitems' + lineitem: '%application_host%/platform/service/ags/default/lineitems/label' ACS: name: !php/const \OAT\Library\Lti1p3Core\Message\Payload\LtiMessagePayloadInterface::CLAIM_LTI_ACS value: diff --git a/config/services.yaml b/config/services.yaml index 0df9993..8251954 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -10,6 +10,8 @@ parameters: application_vendors: '%kernel.project_dir%/vendor/composer/installed.php' application_version: '2.4.2' container.dumper.inline_factories: true + cache.redis.namespace: '%env(default:cache.redis.namespace.default:REDIS_CACHE_NAMESPACE)%' + cache.redis.namespace.default: 'devkit' services: _defaults: diff --git a/docker/kube/Dockerfile b/docker/kube/Dockerfile index a6f0faf..584dddc 100644 --- a/docker/kube/Dockerfile +++ b/docker/kube/Dockerfile @@ -1,5 +1,5 @@ #{{{ fpm -FROM php:8-fpm-alpine as fpm +FROM php:8.1.8-fpm-alpine3.16 as fpm RUN set -eux; \ apk add --no-cache --virtual .build-deps \ @@ -25,14 +25,9 @@ RUN set -eux; \ ; \ yes "" | pecl install redis igbinary \ ;\ - docker-php-ext-install intl; \ - docker-php-ext-install gd; \ - docker-php-ext-install opcache; \ - docker-php-ext-install zip; \ - docker-php-ext-install calendar; \ + docker-php-ext-install intl gd opcache zip calendar; \ \ - docker-php-ext-enable redis; \ - docker-php-ext-enable igbinary; \ + docker-php-ext-enable redis igbinary; \ runDeps="$( \ scanelf --needed --nobanner --format '%n#p' --recursive /usr/local \ | tr ',' '\n' \ @@ -41,7 +36,7 @@ RUN set -eux; \ )"; \ apk add --no-cache $runDeps; \ apk del --no-network .build-deps; \ - rm -rf /var/www/html; \ + apk upgrade; \ chmod 0777 /tmp/; RUN set -eux; \ diff --git a/src/DependencyInjection/Compiler/RedisPass.php b/src/DependencyInjection/Compiler/RedisPass.php new file mode 100644 index 0000000..13f7e1c --- /dev/null +++ b/src/DependencyInjection/Compiler/RedisPass.php @@ -0,0 +1,37 @@ +getParameter('cache.redis.namespace'); + $container + ->getDefinition('cache.adapter.redis') + ->setArgument('$namespace', $redisCacheNamespace); + } +} diff --git a/src/Kernel.php b/src/Kernel.php index 5fa4f05..ce84de4 100644 --- a/src/Kernel.php +++ b/src/Kernel.php @@ -21,6 +21,7 @@ namespace App; use App\DependencyInjection\Compiler\ConfigurationPass; +use App\DependencyInjection\Compiler\RedisPass; use App\DependencyInjection\Security\Factory\ApiKeyFactory; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Component\Config\Loader\LoaderInterface; @@ -64,6 +65,7 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa $confDir = $this->getProjectDir().'/config'; $container->addCompilerPass(new ConfigurationPass()); + $container->addCompilerPass(new RedisPass()); $loader->load($confDir.'/{packages}/*'.self::CONFIG_EXTS, 'glob'); $loader->load($confDir.'/{packages}/'.$this->environment.'/*'.self::CONFIG_EXTS, 'glob');