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

workaround .env file #1393

Closed
g4ze opened this issue Feb 8, 2024 · 8 comments
Closed

workaround .env file #1393

g4ze opened this issue Feb 8, 2024 · 8 comments
Assignees
Labels
kind/feature New feature or request

Comments

@g4ze
Copy link

g4ze commented Feb 8, 2024

We at intelowlproject/IntelOwl#2107 (comment) are trying to implement an analyzer of phoneinfoga . For this, we deem it unsuitable for our framework to put in api the API keys in the .env file. Instead, it could be feasible if we can pass the api key with the request to the endpoint itself and not have it picked from the .env file.

@sundowndev
Copy link
Owner

Hi @g4ze, this could be solved by the introduction of scanner options which is basically adding support for optional parameters for existing scanners. This could be quickly implemented without breaking change and used through the API like this:

curl -X 'POST' \
  'http://localhost:5000/api/v2/scanners/numverify/run' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{"number": "33679368229", "options": {"api_key": "secret"}}'

If it's not specified, the environment variable is used. Could you confirm that this would solve your case?
Thanks

@g4ze
Copy link
Author

g4ze commented Feb 8, 2024

Thanks for the attention! So you basically you mean that we'd need change https://github.com/sundowndev/phoneinfoga/cmd/scan.go
a bit, in a way to have ScanCmdOptions struct include another variable? I'm not too fluent with golang but maybe i can try to raise a PR and add the functionality if you like.
And yes the addition of optional parameters for existing scanners, and using it through the way you mentioned would solve my use case.

@sundowndev
Copy link
Owner

No I'm talking about the REST API only, not the command line. If I understand correctly, you plan to integrate phoneinfoga in your project by using the REST API, is that right?

For this we'll need to change the scanner interface here to accept those options. If this can wait a week or so I can take care of the changes.

@g4ze
Copy link
Author

g4ze commented Feb 9, 2024

my bad. yes, you understood our problem well. We can wait a week or so. Please keep us updated for the same.

@sundowndev sundowndev added the kind/feature New feature or request label Feb 11, 2024
@sundowndev sundowndev self-assigned this Feb 11, 2024
@sundowndev
Copy link
Owner

@g4ze I just released v2.11.0 which contain this new feature. Please give it a try and send us feedback. Read docs here.

@g4ze
Copy link
Author

g4ze commented Feb 21, 2024

works as requested, thankyou very much

@sundowndev
Copy link
Owner

Cool! After reviewing your PR, I suggest that you use a fixed docker tag, instead of using the latest tag (here) because it could lead to breaking change when we release v3 for example. You can use the v2 tag as well.

Anyway, I can close this one.

@g4ze
Copy link
Author

g4ze commented Feb 21, 2024

hmm, makes sense. Thankyou for the suggestion :3 !

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

No branches or pull requests

2 participants