Compare commits

..

2 Commits

Author SHA1 Message Date
49d47904b7 delete patch 2024-10-29 17:33:04 +01:00
eaaa026b5d delete patch 2024-10-29 17:32:45 +01:00
8 changed files with 1 additions and 169 deletions

View File

@@ -6,7 +6,6 @@ ENV NODE_ENV=${NODE_ENV}
WORKDIR /opt/
COPY package.json package-lock.json ./
COPY ./patches ./patches
RUN npm config set fetch-retry-maxtimeout 600000 -g && npm install
RUN npx patch-package

View File

@@ -1,5 +1,3 @@
const PassportZitadel = require('passport-zitadel');
module.exports = ({ env }) => ({
auth: {
secret: env('ADMIN_JWT_SECRET'),

View File

@@ -1,40 +0,0 @@
const PassportZitadel = require('passport-zitadel');
module.exports = ({ env }) => ({
auth: {
secret: env('ADMIN_JWT_SECRET'),
providers: [
{
uid: "zitadel-introspection",
displayName: "Trompxtette",
icon: "",
createStrategy: (strapi) =>
new PassportZitadel.ZitadelIntrospectionStrategy(
{
authority: 'https://trompette.espace120.fr',
clientId: '282357429163868163@infra',
clientSecret: 'Ln4gf8LjLi0JDirTwgs7N1pNQkehN0IBX0VHbzjlnvBP5fwhXldUMcy1FsyPBlbz',
},
(accessToken, refreshToken, profile, done) => {
done(null, {
email: profile.email,
username: profile.username,
});
}
),
},
],
},
apiToken: {
salt: env('API_TOKEN_SALT'),
},
transfer: {
token: {
salt: env('TRANSFER_TOKEN_SALT'),
},
},
flags: {
nps: env.bool('FLAG_NPS', true),
promoteEE: env.bool('FLAG_PROMOTE_EE', true),
},
});

View File

@@ -1,21 +1 @@
module.exports = ({ env }) => ({
email: {
config: {
provider: "strapi-provider-email-smtp",
providerOptions: {
host: "smtp.gmail.com", //SMTP Host
port: 465, //SMTP Port
secure: true,
username: "CHANGEME",
password: "CHANGEME",
rejectUnauthorized: true,
requireTLS: true,
connectionTimeout: 1,
},
},
settings: {
defaultFrom: "CHANGEME",
defaultReplyTo: "CHANGEME",
},
},
});
module.exports = () => ({});

View File

@@ -21,8 +21,6 @@ services:
- ./src:/opt/app/src
- ./package.json:/opt/package.json
- ./package-lock.json:/opt/package-lock.json
- ./license.txt:/opt/licence.txt
- ./patches:/opt/patches
- ./.env:/opt/app/.env
- ./public/uploads:/opt/app/public/uploads

View File

@@ -1,48 +0,0 @@
diff --git a/node_modules/@strapi/plugin-users-permissions/server/bootstrap/grant-config.js b/node_modules/@strapi/plugin-users-permissions/server/bootstrap/grant-config.js
index 013e92c..720ce69 100644
--- a/node_modules/@strapi/plugin-users-permissions/server/bootstrap/grant-config.js
+++ b/node_modules/@strapi/plugin-users-permissions/server/bootstrap/grant-config.js
@@ -137,4 +137,12 @@ module.exports = (baseURL) => ({
callback: `${baseURL}/keycloak/callback`,
scope: ['openid', 'email', 'profile'],
},
+ trompette: {
+ enabled: true,
+ icon: '',
+ key: '',
+ secret: '',
+ callback: `${baseURL}/trompette/callback`,
+ scope:['openid', 'email', 'profile']
+ }
});
diff --git a/node_modules/@strapi/plugin-users-permissions/server/services/providers-registry.js b/node_modules/@strapi/plugin-users-permissions/server/services/providers-registry.js
index a559971..d0c508d 100644
--- a/node_modules/@strapi/plugin-users-permissions/server/services/providers-registry.js
+++ b/node_modules/@strapi/plugin-users-permissions/server/services/providers-registry.js
@@ -347,6 +347,21 @@ const getInitialProviders = ({ purest }) => ({
};
});
},
+ async trompette({ accessToken }) {
+ const trompette = purest({ provider: 'trompette' });
+ //const { body: userBody } = await trompette.get('user').auth(accessToken).request();
+
+ return keycloak
+ .get('user')
+ .auth(accessToken)
+ .request()
+ .then(({ body }) => {
+ return {
+ username: body.preferred_username,
+ email: body.email,
+ };
+ });
+ }
});
module.exports = () => {
@@ -373,3 +388,4 @@ module.exports = () => {
},
};
};
+

View File

@@ -1,31 +0,0 @@
diff --git a/node_modules/grant/config/oauth.json b/node_modules/grant/config/oauth.json
index 54afd00..4a2ba1e 100644
--- a/node_modules/grant/config/oauth.json
+++ b/node_modules/grant/config/oauth.json
@@ -1179,5 +1179,11 @@
"access_url": "https://zoom.us/oauth/token",
"oauth": 2,
"scope_delimiter": " "
- }
+ },
+ "trompette": {
+ "authorize_url": "https://trompette.espace120.fr/oauth/v2/authorize",
+ "access_url": "https://trompette.espace120.fr/oauth/v2/token",
+ "oauth": 2,
+ "scope_delimiter": " "
+ }
}
diff --git a/node_modules/grant/config/profile.json b/node_modules/grant/config/profile.json
index c5956c1..e9fe3f5 100644
--- a/node_modules/grant/config/profile.json
+++ b/node_modules/grant/config/profile.json
@@ -634,5 +634,8 @@
},
"zoom": {
"profile_url": "https://api.zoom.us/v2/users/me"
- }
+ },
+ "trompette": {
+ "profile_url": "https://trompette.espace120.fr/oidc/v1/userinfo"
+ }
}

View File

@@ -1,24 +0,0 @@
diff --git a/node_modules/purest/config/providers.json b/node_modules/purest/config/providers.json
index 8dd1dae..d0e5784 100644
--- a/node_modules/purest/config/providers.json
+++ b/node_modules/purest/config/providers.json
@@ -2784,5 +2784,19 @@
"authorization": "Bearer {auth}"
}
}
+ },
+ "trompette": {
+ "default": {
+ "origin": "",
+ "path": "",
+ "headers": {
+ "authorization": "Bearer {auth}"
+ }
+ },
+ "oauth": {
+ "origin": "https://trompette.espace120.fr",
+ "path": "oauth/{version}/{path}",
+ "version": "v2"
+ }
}
}