WIP: feat: DTF's Goteo v4 API #1

Draft
daniel.subiabre wants to merge 21 commits from feat/dtf-api into main
34 changed files with 383 additions and 165 deletions
+1 -1
View File
@@ -17,7 +17,7 @@
###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=b8ec44a08e5f4ba917879713a4a8e63c
APP_LOCALE='es'
APP_LOCALE='en'
# DO NOT LEAVE OPEN UNLESS YOU'VE GUARANTEED THAT TRAFFIC WILL ONLY COME FROM TRUSTED ORIGINS
# https://symfony.com/doc/6.4/deployment/proxies.html
APP_TRUSTED_PROXIES='127.0.0.1,REMOTE_ADDR'
+13 -8
View File
@@ -4,16 +4,21 @@
@source not "../../public";
@theme {
/* Light Theme (default) */
--color-primary: #59E9D3;
--color-secondary: #462949;
--color-tertiary: #E94668;
--color-content: #575757;
/* DTF palette (dtf-web src/styles/global.css); tokens unused by templates keep upstream values */
--color-primary: #cf2626;
--color-secondary: #2c1212;
--color-tertiary: #cf2626;
--color-content: #2c1212;
--color-page: #f3e7d0;
--color-on-primary: #ffffff;
--color-inverse: #2c1212;
--color-on-inverse: #f3e7d0;
/* Extended color tokens for components */
--color-white: #FBFBFB;
--color-black: #3D3D3D;
--color-grey: #F3F3EF;
--color-white: #ffffff;
--color-black: #2c1212;
--color-grey: #d8cbbb;
--color-purple-soft: #FAF9FF;
--color-purple-medium: #F6F5FF;
+4 -4
View File
@@ -1,14 +1,14 @@
api_platform:
title: The v4 API
title: The Goteo v4 API
version: 4.0.0
show_webby: false
collection:
order: "DESC"
openapi:
contact:
name: Fundación Platoniq
url: http://platoniq.net/contact/
email: contacto@platoniq.net
name: Democratic Tech Fund
url: https://democratictech.fund/contact/
email: democratictech@freeknowledge.eu
termsOfService:
license:
name: AGPL
+1 -1
View File
@@ -26,7 +26,7 @@ framework:
http_client:
default_options:
headers:
'User-Agent': 'Platoniq Goteo-v4-API'
'User-Agent': 'DTF Goteo v4 API'
trusted_proxies: '%env(APP_TRUSTED_PROXIES)%'
+9 -5
View File
@@ -1,10 +1,14 @@
knpu_oauth2_client:
clients:
# configure your clients as described here: https://github.com/knpuniversity/oauth2-client-bundle#configuration
google:
type: google
client_id: "%env(GOOGLE_OAUTH_ID)%"
client_secret: "%env(GOOGLE_OAUTH_SECRET)%"
rauthy_dtf:
type: generic
provider_class: App\OAuth2\Client\RauthyProvider
provider_options:
url: https://login.democratictech.fund
client_class: KnpU\OAuth2ClientBundle\Client\OAuth2PKCEClient
client_id: "%env(RAUTHYDTF_OAUTH_ID)%"
client_secret: "%env(RAUTHYDTF_OAUTH_SECRET)%"
redirect_route: oauth_providers_callback
redirect_params:
provider: google
provider: rauthy_dtf
+26
View File
@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20261027180901 extends AbstractMigration
{
public function getDescription(): string
{
return 'Adds DTF-only description fields to project table';
}
public function up(Schema $schema): void
{
$this->addSql('ALTER TABLE project ADD desc_knowledge LONGTEXT DEFAULT NULL, ADD desc_infrastructure LONGTEXT DEFAULT NULL');
}
public function down(Schema $schema): void
{
$this->addSql('ALTER TABLE project DROP desc_knowledge, DROP desc_infrastructure');
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "org.goteo.api",
"name": "dtf-api",
"lockfileVersion": 3,
"requires": true,
"packages": {
+23
View File
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg id="Layer_1" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 2852 620">
<!-- Generator: Adobe Illustrator 30.8.2, SVG Export Plug-In . SVG Version: 2.1.4 Build 7) -->
<defs>
<linearGradient id="warmGradient" x1="0%" y1="0%" x2="100%" y2="0%"><stop offset="0%" stop-color="#FF914D"/><stop offset="48%" stop-color="#FF603A"/><stop offset="100%" stop-color="#CF2626"/></linearGradient>
<style>
.st0 {
fill: url(#warmGradient);
}
.st0, .st1 {
fill-rule: evenodd;
}
.st1 {
fill: #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22l-2,2h-12v22l2,2h10l2,2v32l2,2v16l2,2v4l8,8h2l6,4h6l2,2h12l2-2h8l2-2v-22l-2-2-2,2h-8l-8-6v-38l2-2h18v-24h-10l-2-2h-6l-2-2v-22l-2-2h-28ZM651.14,452l-18,18v2l-4,4v2l-4,6v6l-2,2v12l-2,2v12l2,2v10l2,2,2,10,6,8v2l14,14h2l14,8h6l2,2h24l2-2h6l2-2,10-4,6-6,2,2v10h24l2-2v-28l-2-2v-38l-2-2h-58l-2,2v6l2,2v16h26l2,2-2,2v4l-8,8h-2l-2,2h-4l-2,2h-14l-2-2h-4l-2-2h-2l-8-8v-2l-6-8v-30l2-2,2-6,8-10h2l6-4h4l2-2h10l2,2h6l2,2h2l8,8v4l2,2h30l2-2v-4l-2-2v-4l-2-2-2-6-4-4v-2l-10-10h-2l-14-8h-6l-2-2h-30l-2,2h-6l-2,2h-4l-2,2-6,2ZM389.14,444v130h28v-8l2-2,6,6h2l6,4h4l2,2h20l6-4h4l4-4h2l8-8v-2l6-8v-4l2-2v-6l2-2v-18l-2-2v-8l-4-6v-4l-6-6v-2l-2-2h-2l-6-6h-2l-6-4h-10l-2-2h-4l-2,2h-6l-2,2h-4l-12,8-2-2v-42h-30ZM433.14,504h14l2,2h2l8,8v4l2,2v16l-8,10h-2l-2,2h-4l-2,2h-4l-2-2h-4l-2-2h-2l-8-8v-4l-2-2v-10l2-2v-4l4-4v-2l8-6ZM667.14,96v80h70l2,2h4l2,2v232l4,4h104l2-2h2v-234l4-4h82v-44l2-2v-16l-2-2v-16h-276ZM385.14,96l-2,2v30l2,2v66l-2,2,2,2-2,2v70l2,2v18l-2,2,2,2v48l-2,2v66l2,2v2h144l2-2h12l2-2h8l2-2h6l2-2h6l2-2h4l6-4h4l2-2,10-4,4-4,6-2,6-6h2l4-4h2l14-14v-2l10-10v-2l8-10v-2l10-18v-4l2-2v-4l2-2v-8l2-2v-6l2-2v-10l2-2v-50l-2-2v-10l-2-2v-8l-2-2v-6l-2-2-2-10-2-2-10-22-6-6v-2l-4-4v-2l-20-20h-2l-6-6h-2l-10-8h-2l-18-10h-4l-6-4h-6l-2-2h-8l-2-2h-8l-2-2h-158ZM481.14,174h34l2,2h12l2,2h4l2,2,10,4,6,6h2l4,4v2l10,10v2l6,10v4l2,2v6l2,2v12l2,2v14l-2,2v16l-2,2v6l-2,2-8,18-16,16h-2l-4,4h-2l-6,4h-4l-2,2h-4l-2,2h-44l-2-2v-156l2-2ZM1193.14,96h-222l-2-2-2,2h-2v318l2,2h98l2-2v-108l2-2h4l2-2h96l2,2,2-2h2v-78h-16l-2-2h-2l-2,2h-4l-2-2h-60l-2,2h-6l-2-2h-10l-2-2v-42l2-2h122l4-4v-4l-2-2v-4l2-2v-30l-2-2,2-2v-2l-2-2v-26Z"/>
<polygon class="st0" points="111.12 581 113.12 579 115.12 579 129.12 565 129.12 563 133.12 557 133.12 553 135.12 551 135.12 545 137.12 543 137.12 423 139.12 421 199.12 481 201.12 481 219.12 499 221.12 499 223.12 501 227.12 501 229.12 503 233.12 503 235.12 505 257.12 505 259.12 503 263.12 503 265.12 501 275.12 497 289.12 483 289.12 481 295.12 471 295.12 467 297.12 465 297.12 443 295.12 441 295.12 437 293.12 435 291.12 429 287.12 425 287.12 423 227.12 363 225.12 363 211.12 347 213.12 345 303.12 345 305.12 343 311.12 343 313.12 341 317.12 341 325.12 335 327.12 335 335.12 327 335.12 325 343.12 315 343.12 311 345.12 309 345.12 299 347.12 297 347.12 291 345.12 289 345.12 283 343.12 281 341.12 271 337.12 267 337.12 265 327.12 255 325.12 255 321.12 251 317.12 251 315.12 249 311.12 249 309.12 247 301.12 247 299.12 245 253.12 245 251.12 247 231.12 247 229.12 245 213.12 245 211.12 243 257.12 197 259.12 197 259.12 195 271.12 183 273.12 183 285.12 171 285.12 169 291.12 163 291.12 161 295.12 155 295.12 151 297.12 149 297.12 125 295.12 123 295.12 119 289.12 111 289.12 109 275.12 95 273.12 95 267.12 91 263.12 91 261.12 89 251.12 89 249.12 87 243.12 87 241.12 89 233.12 89 231.12 91 227.12 91 225.12 93 219.12 95 205.12 109 203.12 109 139.12 173 137.12 171 137.12 63 135.12 61 135.12 55 133.12 53 133.12 49 127.12 41 127.12 39 117.12 29 115.12 29 105.12 23 101.12 23 99.12 21 73.12 21 71.12 23 67.12 23 65.12 25 59.12 27 43.12 43 43.12 45 39.12 51 39.12 57 37.12 59 37.12 551 39.12 553 39.12 557 45.12 565 45.12 567 55.12 577 57.12 577 61.12 581 111.12 581"/>
</svg>

After

Width:  |  Height:  |  Size: 8.0 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 22 KiB

+13
View File
@@ -0,0 +1,13 @@
<svg width="100%" height="100%" style="display: block;" viewBox="0 0 28 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<style>
path {
fill: var(--color-black, #3d3d3d);
}
@media (prefers-color-scheme: dark) {
path {
fill: var(--color-white, #fbfbfb);
}
}
</style>
<path id="path2" d="M14.075 0.00383104C14.1746 -0.0170173 14.185 0.0507396 14.1919 0.121971C15.867 5.34883 18.2921 8.77056 21.4412 12.3191C24.4543 15.7139 27.9386 18.9289 28.2236 24.8681C28.447 29.5355 26.4091 33.3091 24.2482 35.6571C21.837 38.2788 17.9222 40.0831 13.8412 39.9971C9.6458 39.9076 6.21173 38.0521 3.78492 35.3062C1.36765 32.5716 -0.29353 29.1099 0.043382 24.3981C0.537924 17.473 5.72585 14.0912 9.04733 9.73914C11.2065 6.90724 12.7135 3.97805 14.075 0.00383104ZM5.42185 25.8071C5.46342 28.9683 7.1679 31.854 9.51502 33.3134C12.8261 35.3713 17.432 34.844 20.1559 32.139C21.5936 30.7126 22.5697 28.7216 22.8451 25.8071C19.2093 25.8071 18.3795 25.7533 14.1547 25.7533C14.1547 22.8597 14.1928 19.7854 14.1928 16.8936C9.14087 16.8806 5.36035 21.0572 5.42185 25.8071Z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

+37
View File
@@ -0,0 +1,37 @@
<svg
preserveAspectRatio="none"
width="100%"
height="100%"
overflow="visible"
style="display: block; --logo-color: var(--fill-0, var(--color-variant1, #e6e5f7));"
viewBox="0 0 132 40"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<g id="g14" fill="var(--logo-color)">
<path
id="path2"
d="M14.075 0.00383104C14.1746 -0.0170173 14.185 0.0507396 14.1919 0.121971C15.867 5.34883 18.2921 8.77056 21.4412 12.3191C24.4543 15.7139 27.9386 18.9289 28.2236 24.8681C28.447 29.5355 26.4091 33.3091 24.2482 35.6571C21.837 38.2788 17.9222 40.0831 13.8412 39.9971C9.6458 39.9076 6.21173 38.0521 3.78492 35.3062C1.36765 32.5716 -0.29353 29.1099 0.043382 24.3981C0.537924 17.473 5.72585 14.0912 9.04733 9.73914C11.2065 6.90724 12.7135 3.97805 14.075 0.00383104ZM5.42185 25.8071C5.46342 28.9683 7.1679 31.854 9.51502 33.3134C12.8261 35.3713 17.432 34.844 20.1559 32.139C21.5936 30.7126 22.5697 28.7216 22.8451 25.8071C19.2093 25.8071 18.3795 25.7533 14.1547 25.7533C14.1547 22.8597 14.1928 19.7854 14.1928 16.8936C9.14087 16.8806 5.36035 21.0572 5.42185 25.8071Z"
/>
<path
id="path4"
d="M54.5328 19.9414C53.1176 20.0865 51.6349 20.1629 50.2058 20.2941C49.9226 19.8276 49.6143 19.4385 49.3873 19.1205C48.9396 18.4951 48.0423 17.6707 47.1658 17.3614C43.4156 16.0402 39.5632 18.5741 39.0981 22.756C38.6746 26.553 40.2258 30.4838 43.4243 31.3168C47.2004 32.3019 49.8291 29.8887 50.4509 26.9934C49.0409 26.9934 47.1312 27.0516 45.5289 26.976C45.5289 25.7642 45.5289 24.5541 45.5289 23.3397C48.6858 23.3397 51.8436 23.3397 54.9997 23.3397C54.9867 28.0158 54.0539 30.8616 51.8427 32.9569C48.0743 36.5289 41.1854 36.1354 37.6942 32.7215C35.4648 30.5411 34.325 27.0985 34.6533 22.7507C35.0344 17.7211 38.3377 13.6339 44.008 13.1336C49.8628 12.6211 53.3073 15.5025 54.5328 19.9414Z"
/>
<path
id="path6"
d="M66.4565 13.2572C72.8726 12.9314 77.4395 17.6527 77.4499 24.1643C77.4638 31.1729 72.5001 35.4224 66.8082 35.4224C61.1638 35.4233 57.1546 31.3657 56.635 26.0407C55.9256 18.7246 59.9028 13.5881 66.4565 13.2572ZM61.5475 27.6816C62.3417 29.763 64.2991 31.3918 66.809 31.4352C75.1114 31.582 75.0032 16.1186 66.2244 17.2444C62.1477 17.7665 59.6923 22.8274 61.5475 27.6816Z"
/>
<path
id="path8"
d="M120.366 13.2574C126.32 12.9316 130.809 16.9849 131.357 22.64C132.044 29.7163 127.675 35.4226 120.834 35.4226C114.497 35.4235 110.558 30.5797 110.544 24.5155C110.53 18.2836 114.162 13.5944 120.366 13.2574ZM117.911 17.9482C113.593 20.6898 113.879 31.4806 120.951 31.4354C126.238 31.4006 128.668 24.1767 125.863 19.8246C124.808 18.1906 122.739 16.8633 120.133 17.2446C118.957 17.4157 118.54 17.5469 117.911 17.9482Z"
/>
<path
id="path10"
d="M93.0043 13.4909C93.0043 14.8209 93.0043 16.15 93.0043 17.479C91.1725 17.479 89.3407 17.479 87.5081 17.479C87.5081 23.3044 87.5081 29.1289 87.5081 34.9543C86.0643 34.9543 84.6239 34.9543 83.181 34.9543C83.181 29.1672 83.181 23.2914 83.181 17.506C81.4306 17.506 79.6023 17.479 77.8026 17.479C77.8026 16.0405 77.7766 14.8591 77.7766 13.4909C82.8034 13.4909 87.9749 13.4909 93.0043 13.4909Z"
/>
<path
id="path12"
d="M108.908 13.4909C108.908 14.7818 108.962 16.1751 108.962 17.4651C105.927 17.4651 103.033 17.479 99.9053 17.479C99.9053 19.0036 99.9053 20.6645 99.9053 22.1873C102.587 22.1873 105.346 22.1708 108.325 22.1708C108.325 23.459 108.325 24.7499 108.325 26.0399C105.519 26.0399 102.713 26.0399 99.9053 26.0399C99.9053 27.8485 99.8663 29.6588 99.8663 31.1069C102.786 31.1069 105.144 31.0826 108.791 31.0826C108.791 32.3726 108.791 33.6634 108.791 34.9534C104.349 34.9534 99.9053 34.9534 95.4631 34.9534C95.5393 27.8389 95.3055 20.4108 95.5783 13.49C100.021 13.4909 104.464 13.4909 108.908 13.4909Z"
/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.8 KiB

+3
View File
@@ -0,0 +1,3 @@
<svg width="733" height="286" viewBox="0 0 733 286" fill="none" xmlns="http://www.w3.org/2000/svg">
<path opacity="0.08" d="M389.252 -536.894C392.003 -537.47 392.29 -535.599 392.481 -533.633C438.746 -389.325 505.726 -294.854 592.705 -196.882C675.928 -103.155 772.165 -14.393 780.035 149.581C786.207 278.444 729.919 382.627 670.235 447.454C603.637 519.836 495.512 569.649 382.793 567.275C266.917 564.805 172.068 513.576 105.04 437.765C38.2743 362.265 -7.60729 266.692 1.69821 136.606C15.3574 -54.5891 158.648 -147.956 250.387 -268.113C310.024 -346.299 351.647 -427.17 389.252 -536.894ZM150.251 175.507C151.4 262.783 198.477 342.455 263.305 382.747C354.757 439.564 481.972 425.006 557.206 350.322C596.915 310.941 623.875 255.971 631.482 175.507C531.059 175.507 508.142 174.02 391.453 174.02C391.453 94.1317 392.505 9.25458 392.505 -70.586C252.971 -70.9458 148.553 44.3662 150.251 175.507Z" fill="#E6E5F7"/>
</svg>

After

Width:  |  Height:  |  Size: 912 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

@@ -202,6 +202,16 @@ class ProjectApiResource
*/
public string $descTeam;
/**
* Rich-text (markdown allowed) about knowledge, tools and resources that will remain in the commons.
*/
public string $descKnowledge;
/**
* Rich-text (markdown allowed) about how does the project reduce dependence on proprietary platforms.
*/
public string $descInfrastructure;
/**
* Extracted embedding data from the Project's video.
*/
+4
View File
@@ -85,6 +85,10 @@ class InvestsPump implements PumpInterface
public function pump(mixed $record, array $context): void
{
if (!in_array($record['project'], ProjectsPump::SELECTED_PROJECTS)) {
return;
}
if (!$record['user'] || empty($record['user'])) {
return;
}
+4
View File
@@ -48,6 +48,10 @@ class ProjectsBudgetPump implements PumpInterface
public function pump(mixed $record, array $context): void
{
if (!in_array($record['project'], ProjectsPump::SELECTED_PROJECTS)) {
return;
}
if (empty($record['cost']) || empty($record['amount'])) {
return;
}
+24 -1
View File
@@ -29,6 +29,29 @@ class ProjectsPump implements PumpInterface
use TerritoryPumpTrait;
use CategorizationPumpTrait;
public const SELECTED_PROJECTS = [
'la-nuestra-despega',
'la-nuestra',
'un-netflix-para-el-99-decenas-de-creadores-y-cinea',
'iridia-vs-pegasus',
'impulsa-la-cooperativa-de-informacion-climatica',
'amb-memoria-drets-humans',
'ara-drets-humans',
'amb-memoria-drets-humans',
'quien-cuida-a-las-que-cuidan',
'con-vosotras-si-campana-de-financiacion-duque-de-a',
'top-manta-bcn',
'salvem-el-delta-del-llobregat',
'refugio-una-huida-para-sobrevivir',
'plokte',
'lanzamos-sonda-internacional-y-los-cinco-elementos',
'la-kacharreria',
'portal-de-ressenyes-sobre-pisos',
'indicat-de-llogaters-i-llogateres/',
'jornaleras',
'las-kellys',
];
public function __construct(
private ProjectRepository $projectRepository,
private PumpedUserRepository $userRepository,
@@ -47,7 +70,7 @@ class ProjectsPump implements PumpInterface
public function pump(mixed $record, array $context): void
{
if (empty($record['name'])) {
if (empty($record['name']) || !in_array($record['id'], self::SELECTED_PROJECTS)) {
return;
}
+4
View File
@@ -52,6 +52,10 @@ class ProjectsRewardsPump implements PumpInterface
public function pump(mixed $record, array $context): void
{
if (!in_array($record['project'], ProjectsPump::SELECTED_PROJECTS)) {
return;
}
if (empty($record['reward']) || empty($record['amount'])) {
return;
}
+6 -5
View File
@@ -75,9 +75,10 @@ class UsersPump implements PumpInterface
private function processUser(User $user, array $record, array $context): User
{
$user->setHandle($this->buildHandle($record));
$handle = hash('sha256', $record['email']);
$user->setHandle($handle);
$user->setPassword($record['password'] ?? '');
$user->setEmail($record['email']);
$user->setEmail(\sprintf('%s@goteo.org', $handle));
$user->setEmailConfirmed(false);
$user->setActive(false);
$user->setMigrated(true);
@@ -85,11 +86,11 @@ class UsersPump implements PumpInterface
$user->setDateCreated($this->getDateCreated($record));
$user->setDateUpdated(new \DateTime());
$user->setType($this->getUserType($record));
$user->setLinks($this->getLinks($record));
// $user->setLinks($this->getLinks($record));
$user->setTerritory($this->getTerritory($record));
$user->setDescription($record['about']);
// $user->setDescription($record['about']);
$user->setRoles($this->getRoles($record, $context));
$user->setAvatar($this->getAvatar($record));
// $user->setAvatar($this->getAvatar($record));
match ($user->getType()) {
UserType::Individual => $user = $this->setUserPerson($record, $user),
+1 -1
View File
@@ -162,7 +162,7 @@ class ResetPasswordController extends AbstractController
}
$email = (new TemplatedEmail())
->from(new Address($this->mailerAddress, 'Goteo'))
->from(new Address($this->mailerAddress, 'DTFCrowd by Goteo'))
->to((string) $user->getEmail())
->subject($translator->trans('password_reset.email.subject'))
->htmlTemplate('reset_password/email.html.twig')
+2 -2
View File
@@ -37,7 +37,7 @@ class ProjectCreationDto
* @var CategoryApiResource[]
*/
#[Assert\NotBlank()]
#[Assert\Count(min: 1, max: 2)]
#[Assert\Count(exactly: 1)]
#[API\ApiProperty(writableLink: false, openapiContext: self::CATEGORIES_OPENAPI_CONTEXT)]
public array $categories;
@@ -46,7 +46,7 @@ class ProjectCreationDto
*
* @var ThemeApiResource[]
*/
#[Assert\Count(max: 1)]
#[Assert\Count(min: 1, max: 2)]
#[API\ApiProperty(writableLink: false, openapiContext: self::THEMES_OPENAPI_CONTEXT)]
public array $themes;
+12
View File
@@ -87,6 +87,18 @@ class ProjectUpdationDto
#[Assert\Length(min: 20)]
public string $descTeam;
/**
* Rich-text (markdown allowed) about knowledge, tools and resources that will remain in the commons.
*/
#[Assert\Length(min: 20)]
public string $descKnowledge;
/**
* Rich-text (markdown allowed) about how does the project reduce dependence on proprietary platforms.
*/
#[Assert\Length(min: 20)]
public string $descInfrastructure;
/**
* On `minimum`, Project will campaign until the minimum deadline.\
* On `optimum`, Project will campaing until the minimum deadline,
+30
View File
@@ -182,6 +182,12 @@ class Project implements UserOwnedInterface, AccountingOwnerInterface, Localized
#[ORM\ManyToMany(targetEntity: Theme::class, cascade: ['persist'])]
private Collection $themes;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $descKnowledge = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $descInfrastructure = null;
public function __construct()
{
$this->accounting = Accounting::of($this);
@@ -683,4 +689,28 @@ class Project implements UserOwnedInterface, AccountingOwnerInterface, Localized
return $this;
}
public function getDescKnowledge(): ?string
{
return $this->descKnowledge;
}
public function setDescKnowledge(?string $descKnowledge): static
{
$this->descKnowledge = $descKnowledge;
return $this;
}
public function getDescInfrastructure(): ?string
{
return $this->descInfrastructure;
}
public function setDescInfrastructure(?string $descInfrastructure): static
{
$this->descInfrastructure = $descInfrastructure;
return $this;
}
}
+112
View File
@@ -0,0 +1,112 @@
<?php
namespace App\OAuth2\Client;
use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Provider\Exception\IdentityProviderException;
use League\OAuth2\Client\Provider\ResourceOwnerInterface;
use League\OAuth2\Client\Token\AccessToken;
use Psr\Http\Message\ResponseInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* Provides supports for OAuth2 Authorization Code flows with Rauthy instances.
*
* HOW-TO USE
* 1. Add a .png image in `public/oauth2/providers` dir to show the provider's logo in the login page
* 2. Add a new provider under `clients` key in `config/packages/knpu_oauth2_client.yaml`:
* ```yaml
* rauthy_<instance name>:
* type: generic
* provider_class: App\OAuth2\Client\RauthyProvider
* provider_options:
* url: <instance web address>
* client_id: "%env(<instance's OAuth2 Client id>)%"
* client_secret: "%env(<instance's OAuth2 Client secret>)%"
* redirect_route: oauth_providers_callback
* redirect_params:
* provider: rauthy_<instance name>
* ```
*/
class RauthyProvider extends AbstractProvider
{
private string $providerUri;
private string $providerClient;
/**
* @param array{url: string, clientId: string, clientSecret: string, redirectUri: string} $options
*/
public function __construct(
array $options = [],
array $collaborators = [],
) {
if (!\array_key_exists('url', $options)) {
throw new \Exception("Key 'url' must be given in the options array");
}
$this->providerUri = $options['url'];
$this->providerClient = $options['clientId'];
return parent::__construct($options, $collaborators);
}
public function getBaseAuthorizationUrl(): string
{
return \sprintf('%s/auth/v1/oidc/authorize', $this->providerUri);
}
public function getBaseAccessTokenUrl(array $params): string
{
return \sprintf('%s/auth/v1/oidc/token', $this->providerUri);
}
public function getResourceOwnerDetailsUrl(AccessToken $token): string
{
return \sprintf('%s/auth/v1/oidc/userinfo', $this->providerUri);
}
public function getDefaultScopes(): array
{
return [
'email openid profile groups',
];
}
protected function checkResponse(ResponseInterface $response, $data): void
{
$code = $response->getStatusCode();
if ($code === Response::HTTP_OK) {
return;
}
throw new IdentityProviderException('The instance returned a non-OK HTTP response', $code, $response);
}
protected function fetchResourceOwnerDetails(AccessToken $token): mixed
{
$accessToken = $token->getToken();
$url = $this->getResourceOwnerDetailsUrl($token);
$request = $this->getRequest(Request::METHOD_GET, $url, [
'headers' => [
'Authorization' => "Bearer $accessToken",
'X-Jwt-Aud' => $this->providerClient,
'Accept' => 'application/json',
],
]);
return $this->getParsedResponse($request);
}
protected function createResourceOwner(array $response, AccessToken $token): ResourceOwnerInterface
{
return new TokenOwner(
$response['email'],
$response['given_name'],
$response['family_name']
);
}
}
+3
View File
@@ -1,4 +1,7 @@
# Introduction
DTF's Goteo v4 API instance by [Platoniq](https://platoniq.net/).
[Co-op Cloud Git](https://git.coopcloud.tech/DemocraticTech.Fund/crowd-fund)
The v4 API is a multi-capable web API based on the [API Platform](https://api-platform.com/) framework, built to support the future generation of the [Goteo](https://goteo.org) crowdfunding platform, aiming to be it's new underlying engine.
+3 -3
View File
@@ -4,10 +4,10 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>
{% block title %}Welcome!
{% block title %}DTFcrowd
{% endblock %}
</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text></svg>">
<link rel="icon" href="{{ asset('images/brand/favicon.svg') }}" sizes="any" type="image/svg+xml">
{% block stylesheets %}
{{ encore_entry_link_tags('app') }}
{% endblock %}
@@ -16,7 +16,7 @@
{{ encore_entry_script_tags('app') }}
{% endblock %}
</head>
<body class="bg-white font-body flex flex-col min-h-dvh">
<body class="bg-page text-content font-body flex flex-col min-h-dvh">
{{ include('header.html.twig') }}
<main class="grow">
{% block body %}
File diff suppressed because one or more lines are too long
+1 -17
View File
@@ -5,23 +5,7 @@
<div class="flex items-center justify-between px-2 py-3 md:px-4 md:py-6" id="header-main">
<div class="flex items-center gap-2 md:gap-4">
<a href="/" class="shrink-0">
<svg width="97" height="24" viewbox="0 0 97 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M19.8701 7.67198C18.4595 7.81705 16.9816 7.8935 15.5572 8.02467C15.2749 7.55819 14.9676 7.16902 14.7414 6.85108C14.2951 6.22563 13.4008 5.40125 12.5271 5.092C8.78915 3.77074 4.94931 6.30468 4.48573 10.4865C4.06359 14.2835 5.60971 18.2143 8.79778 19.0474C12.5617 20.0325 15.1817 17.6193 15.8015 14.7239C14.3961 14.7239 12.4926 14.7821 10.8955 14.7066C10.8955 13.4948 10.8955 12.2847 10.8955 11.0703C14.0422 11.0703 17.1897 11.0703 20.3354 11.0703C20.3225 15.7464 19.3927 18.5922 17.1888 20.6874C13.4327 24.2595 6.56622 23.8659 3.08636 20.452C0.864293 18.2716 -0.271774 14.8291 0.0554068 10.4813C0.435247 5.45164 3.72777 1.36449 9.37963 0.864131C15.2154 0.351608 18.6486 3.23302 19.8701 7.67198Z"
class="fill-black"></path>
<path
d="M31.7556 0.987442C38.1507 0.661686 42.7028 5.38297 42.7131 11.8946C42.7269 18.9031 37.7795 23.1527 32.1061 23.1527C26.4801 23.1536 22.484 19.096 21.9661 13.771C21.2591 6.45492 25.2232 1.31841 31.7556 0.987442ZM26.8626 15.4119C27.6542 17.4933 29.6052 19.122 32.1069 19.1655C40.3823 19.3123 40.2744 3.84888 31.5242 4.97469C27.4608 5.49677 25.0134 10.5577 26.8626 15.4119Z"
class="fill-black"></path>
<path
d="M85.4884 0.98751C91.4234 0.661755 95.8977 4.71502 96.4433 10.3701C97.1287 17.4464 92.7735 23.1528 85.9554 23.1528C79.6388 23.1537 75.7127 18.3099 75.6988 12.2456C75.685 6.0137 79.3047 1.32456 85.4884 0.98751ZM83.0418 5.67839C78.7376 8.41995 79.0224 19.2107 86.0719 19.1655C91.3413 19.1308 93.7637 11.9068 90.9676 7.55474C89.9161 5.92075 87.8537 4.59341 85.2561 4.97476C84.0847 5.14589 83.6686 5.27706 83.0418 5.67839Z"
class="fill-black"></path>
<path
d="M58.2159 1.22114C58.2159 2.55109 58.2159 3.88018 58.2159 5.20926C56.39 5.20926 54.5642 5.20926 52.7375 5.20926C52.7375 11.0346 52.7375 16.8591 52.7375 22.6845C51.2985 22.6845 49.8628 22.6845 48.4246 22.6845C48.4246 16.8974 48.4246 11.0216 48.4246 5.23619C46.6799 5.23619 44.8576 5.20926 43.0637 5.20926C43.0637 3.77072 43.0378 2.58932 43.0378 1.22114C48.0482 1.22114 53.2028 1.22114 58.2159 1.22114Z"
class="fill-black"></path>
<path
d="M74.0658 1.22117C74.0658 2.51204 74.1193 3.9054 74.1193 5.19539C71.0944 5.19539 68.2094 5.20929 65.0921 5.20929C65.0921 6.73383 65.0921 8.39475 65.0921 9.91755C67.7648 9.91755 70.5152 9.90104 73.484 9.90104C73.484 11.1893 73.484 12.4802 73.484 13.7701C70.6878 13.7701 67.8908 13.7701 65.0921 13.7701C65.0921 15.5787 65.0532 17.3891 65.0532 18.8372C67.9633 18.8372 70.314 18.8128 73.9493 18.8128C73.9493 20.1028 73.9493 21.3937 73.9493 22.6837C69.5215 22.6837 65.0921 22.6837 60.6644 22.6837C60.7403 15.5692 60.5072 8.14109 60.7792 1.22031C65.2078 1.22117 69.6355 1.22117 74.0658 1.22117Z"
class="fill-black"></path>
</svg>
<img src="{{ asset('images/brand/DTFcrowd_dark.svg') }}" alt="DTFcrowd by Goteo" class="w-40 sm:w-56">
</a>
</div>
<nav>
+1 -1
View File
@@ -48,7 +48,7 @@
<div class="flex flex-col items-end">
<button
class="btn btn-lg btn-primary text-secondary disabled:bg-grey flex items-center justify-center gap-2 font-bold transition hover:cursor-pointer px-8 py-4 rounded-3xl bg-primary w-fit"
class="btn btn-lg btn-primary text-on-primary disabled:bg-grey flex items-center justify-center gap-2 font-bold transition hover:cursor-pointer px-8 py-4 rounded-3xl bg-primary w-fit"
type="submit"
>
{{ 'password_reset.request.submit' | trans }}
+1 -1
View File
@@ -61,7 +61,7 @@
<div class="flex flex-col items-end">
<button
class="btn btn-lg btn-primary text-secondary disabled:bg-grey flex items-center justify-center gap-2 font-bold transition hover:cursor-pointer px-8 py-4 rounded-3xl bg-primary w-fit"
class="btn btn-lg btn-primary text-on-primary disabled:bg-grey flex items-center justify-center gap-2 font-bold transition hover:cursor-pointer px-8 py-4 rounded-3xl bg-primary w-fit"
type="submit"
>
{{ 'password_reset.reset.submit' | trans }}
+1 -1
View File
@@ -20,7 +20,7 @@
</div>
<div class="flex flex-col items-end">
<button class="btn btn-lg btn-primary text-secondary disabled:bg-grey flex items-center justify-center gap-2 font-bold transition hover:cursor-pointer px-8 py-4 rounded-3xl bg-primary w-fit" type="submit">
<button class="btn btn-lg btn-primary text-on-primary disabled:bg-grey flex items-center justify-center gap-2 font-bold transition hover:cursor-pointer px-8 py-4 rounded-3xl bg-primary w-fit" type="submit">
{{ 'consent.submit' | trans }}
</button>
</div>
+1 -1
View File
@@ -38,7 +38,7 @@
</div>
<div class="flex flex-col items-end">
<button class="btn btn-lg btn-primary text-secondary disabled:bg-grey flex items-center justify-center gap-2 font-bold transition hover:cursor-pointer px-8 py-4 rounded-3xl bg-primary w-fit" type="submit">
<button class="btn btn-lg btn-primary text-on-primary disabled:bg-grey flex items-center justify-center gap-2 font-bold transition hover:cursor-pointer px-8 py-4 rounded-3xl bg-primary w-fit" type="submit">
{{ 'login.submit' | trans }}
</button>
</div>
+2 -2
View File
@@ -17,8 +17,8 @@ login:
consent:
title: Authorize
description: The application %app% would like permission to access your Goteo account.
tip: You should only give access to your Goteo account to third parties you trust.
description: The application %app% would like permission to access your account.
tip: You should only give access to your account to applications you trust.
consent: Yes, allow access
submit: Continue