Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mise à jour pour Sciences Po Paris #274

Merged
merged 2 commits into from
Jan 8, 2025
Merged

Mise à jour pour Sciences Po Paris #274

merged 2 commits into from
Jan 8, 2025

Conversation

s1w2a3
Copy link
Contributor

@s1w2a3 s1w2a3 commented Dec 19, 2024

Le changement de proxy a rendu l'ancienne adresse obsolète

Cf fix #275

Le changement de proxy a rendu l'ancienne adresse obsolète
@s1w2a3
Copy link
Contributor Author

s1w2a3 commented Dec 21, 2024

Après ces modifications, l'extension ne demande plus automatiquement la permission pour d'accéder aux données pour le nouveau domaine Europresse (maintenant "https://nouveau-europresse-com.scpo.idm.oclc.org/*"). De ce que j'ai compris, le lien entre URL d'authentification et domaine Europresse est fait automatiquement, en cherchant la plus longue correspondance dans les caractères - ce qui ne marche pas ici puisque "sciences po" n'apparaît pas, il est écrit "scpo". Comment faire pour rétablir la demande automatique de permission ?

J'ai l'impression que c'est en rapport avec le dernier message dans le #174

@s1w2a3 s1w2a3 closed this Dec 21, 2024
@s1w2a3 s1w2a3 deleted the patch-1 branch December 21, 2024 10:14
@s1w2a3 s1w2a3 restored the patch-1 branch December 21, 2024 10:15
@s1w2a3 s1w2a3 reopened this Dec 21, 2024
@Write
Copy link
Collaborator

Write commented Dec 21, 2024

Pour ces cas particuliers, je ne vois pas d'autre solution que de définir le mapping à la main.

Par exemple ajouter en plus la PROXY_URL directement après auth.

Ici, ça serait :

 {
	"name": "Sciences Po Paris",
	"AUTH_URL": "https://catalogue-bibliotheque.sciencespo.fr/view/action/uresolver.do?operation=resolveService&package_service_id=20109524480005808&institutionId=5808&customerId=5800&VE=true",
	"PROXY_URL": "https://nouveau-europresse-com.scpo.idm.oclc.org/*"
},	

Et modifier la fonction makePermissionsRequest vers ceci :

 /**
 * Makes a permissions request for the specified partner by checking
 * if a PROXY_URL exists or falling back to a generic matching logic based on AUTH_URL.
 *
 * @param {string} partner_name
 * @returns {{permissions: string[], origins: string[]}}
 */
function makePermissionsRequest(partner_name) {
  const partner = ophirofox_config_list.find(({ name }) => name === partner_name);
  if (!partner) throw new Error(`No partner found with name ${partner_name}`);

  let permission = partner.PROXY_URL;
  if (!permission) {
    permission = permissionForPartner(partner);
  }

  if (!permission) throw new Error(`No valid permission found for partner "${partner_name}"`);

  return { permissions: missing_permissions, origins: [permission] };
}

@lovasoa ton avis ?

@Write Write closed this in #279 Jan 8, 2025
@Write Write reopened this Jan 8, 2025
@Write Write merged commit 2b5b3e0 into lovasoa:master Jan 8, 2025
3 checks passed
Write pushed a commit to Write/ophirofox that referenced this pull request Jan 8, 2025
@Write
Copy link
Collaborator

Write commented Jan 8, 2025

Tu peux me dire si après tous ces changements c'est OK ? Merci !

@Write Write mentioned this pull request Jan 8, 2025
@s1w2a3
Copy link
Contributor Author

s1w2a3 commented Jan 9, 2025

Oui c'est parfait merci beaucoup !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Changement proxy Sciences Po Paris
2 participants