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

Deprecate Presentation Definition by Reference #100

Open
1 task
nanderstabel opened this issue Jul 29, 2024 · 0 comments
Open
1 task

Deprecate Presentation Definition by Reference #100

nanderstabel opened this issue Jul 29, 2024 · 0 comments
Assignees
Labels
Breaking change A change to the API that requires a major release.

Comments

@nanderstabel
Copy link
Collaborator

Description

Remove the option to supply a presentation_definition_id to the /v0/authorization_requests endpoint.

Motivation

The current implementation is quite questionable since it's relying on a bunch of unconventional workarounds like:

  # docker-compose.yml
  volumes:
      # TODO: Remove this. This is a workaround that ensures that the `agent_verification/presentation_definitions`
      # folder can be accessed by the agent from the `fn authorization_requests` endpoint.
      - ./tmp:/app/agent_api_rest

and

    // `agent_api_rest/src/verification/authorization_requests.rs` 
            // TODO: This needs to be properly fixed instead of reading the presentation definitions from the file system
            // everytime a request is made. `PresentationDefinition`'s should be implemented as a proper `Aggregate`. This
            // current suboptimal solution requires the `./tmp:/app/agent_api_rest` volume to be mounted in the `docker-compose.yml`.
            PresentationDefinitionResource::PresentationDefinitionId(presentation_definition_id) => {
                let project_root_dir = env!("CARGO_MANIFEST_DIR");

                serde_json::from_reader(
                    std::fs::File::open(format!(
                        "{project_root_dir}/../agent_verification/presentation_definitions/{presentation_definition_id}.json"
                    ))
                    .unwrap(),
                )
                .unwrap()
            }

Also, Presentation Definition by Value has already been implemented in #72.

In the future we might want to support Presentation Definition by Reference again, but then it must be implemented in a proper way.

Resources

To-do List

  • Deprecate Presentation Definition by Reference
@nanderstabel nanderstabel added the Breaking change A change to the API that requires a major release. label Jul 29, 2024
@nanderstabel nanderstabel self-assigned this Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Breaking change A change to the API that requires a major release.
Projects
None yet
Development

No branches or pull requests

1 participant