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

[feature] Get resource TOTP code (somewhat implemented) #54

Open
pbogut opened this issue Jun 4, 2024 · 1 comment
Open

[feature] Get resource TOTP code (somewhat implemented) #54

pbogut opened this issue Jun 4, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@pbogut
Copy link

pbogut commented Jun 4, 2024

The feature:
I would like to be able to generate TOTP code for resource from the cli.

Work done so far:
In order to make it work the go-passbolt would have to be updated. I did that in this commit: pbogut/go-passbolt@e8b14eb
Then this repo has to be updated to use generated code. I've done it here: pbogut@02607cc

My change works, and code is displayed when getting resource. Note that I did it just for myself as a proof of concept.

Things up for discussion:

  • Is this something that would be merged if pull request was made here and in go-passbolt repo?
  • Should go-passbolt return code, or should it return secret so go-passbolt-cli can generate code?
  • Is it ok to return it when it's available, or should it be only returned via flag?
  • Does any other repo depend on go-passbolt and would have to be updated as well?
@pbogut pbogut added the bug Something isn't working label Jun 4, 2024
@speatzle
Copy link
Collaborator

speatzle commented Jun 6, 2024

Hi, i had a quick look.
I definitely want to support TOTPs in the CLI, as such renaming and deprecation of some flags and basic handling has already landed.

TOTPs use the "new" Resource Type System. go-passbolt has been around since before that has been a thing an thus some assumptions were made such as that a Resource always has the same fields.

For TOTPs and other Upcoming Resource Types to be Properly supported there have to be some core changes made to go-passbolt. The biggest blocker is how go-passbolt's API surface should look for go-passbolt-cli and others consumers to support new types without needing to know about them (possibility of User Created/Modified Resource Types).

If you have any Ideas how such a API could look that would be much Appreciated.

As for your Current Code Changes, since they change the Signature of for the GetResource helper that would break multiple Project i know about when they update go-passbolt and since we will hit this same scenario again with the next Resource Type i would Rather work on fixing this "Properly" and keep the current GetResource Helper the way it is for the Simple Usecase or Deprecate it in favor of the new Resource Type Generic API.

@speatzle speatzle added enhancement New feature or request and removed bug Something isn't working labels Jun 6, 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
Projects
None yet
Development

No branches or pull requests

2 participants