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

Make existence of key info consistent with existence of key #149

Closed
ionut-arm opened this issue Apr 20, 2020 · 3 comments · Fixed by #324
Closed

Make existence of key info consistent with existence of key #149

ionut-arm opened this issue Apr 20, 2020 · 3 comments · Fixed by #324
Labels
enhancement New feature or request

Comments

@ionut-arm
Copy link
Member

ionut-arm commented Apr 20, 2020

Currently we have to check, for each return path within provider methods, whether we have maintained consistency between the existence of the key and the existence of the key info stored in the manager. This applies to key generation, import and destruction.

My idea was that at the beginning of these methods we create (for generate/import) or retrieve (for destroy) the key mapping and feed it to a function that does the rest of the processing (all the param checks, calling the method from the interface underneath). The inner method then returns its Result, and based on that, before returning from the main provider method, we either keep or destroy the mapping.

@ionut-arm ionut-arm added the enhancement New feature or request label Apr 20, 2020
@ionut-arm
Copy link
Member Author

(The point of this issue is to hopefully prevent problems like #139 )

@hug-dev
Copy link
Member

hug-dev commented May 4, 2020

That seems like a good idea!
We would do for import/generate:

  1. Create the mapping
  2. Call the actual operation
  3. Destroy the mapping if 2 failed

Could we do something like:

  1. Call the actual operation
  2. Create the mapping if 1. succeeded

That is very high-level so I am not sure if possible in all providers.

@ionut-arm
Copy link
Member Author

That is very high-level so I am not sure if possible in all providers.

Should be, all providers have some sort of separation between Parsec-specific functionality and the underlying API.

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

Successfully merging a pull request may close this issue.

2 participants