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

Allow to customise API authorisation #214

Open
1 task done
fdionisi opened this issue Apr 30, 2024 · 0 comments
Open
1 task done

Allow to customise API authorisation #214

fdionisi opened this issue Apr 30, 2024 · 0 comments
Labels
enhancement New feature or request triage Newly created issue that needs maintainers validation

Comments

@fdionisi
Copy link
Member

fdionisi commented Apr 30, 2024

Check for existing issues

  • Completed

Describe the feature

Currently the EdcConnectorClient uses the EDC-standard x-api-key to authorise actions against a target connector.

This solutions works well in server-side environment, where the API key can be stored safely away from malicious users, but it doesn't fit a frontend environment which more easily exposes these secrets to the public.

From the experience gained so far, it is common to proxy EDC requests via a proxy which validate permissions through the user's authentication token (e.g., Bearer), and injects the appropriate x-api-key where the request is allowed.

If applicable, add text / mockups / screenshots to help present your vision of the feature

Arguably, implementors would be already able to use the current apiKey solution and passing the authentication bearer token instead of the Connector's secret. But for clarity, it would be nice to have an option that allows to customise the header sent via the EdcConnectorClient

The aim is to enable customisation via a builder field and constructor's option such that:

const client = new EdcConnectorClient.Builder()
  .managementUrl("https://edc.think-it.io/management")
  .authorizationHeader("Authorization")
  .authorizationToken("Bearer ...")
  .build();

await client.management.assets.create({ ... });
@fdionisi fdionisi added enhancement New feature or request triage Newly created issue that needs maintainers validation labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triage Newly created issue that needs maintainers validation
Projects
None yet
Development

No branches or pull requests

1 participant