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

Tagged secrets aren't loaded #1940

Open
mikenikles opened this issue Jun 10, 2024 · 14 comments
Open

Tagged secrets aren't loaded #1940

mikenikles opened this issue Jun 10, 2024 · 14 comments

Comments

@mikenikles
Copy link

Describe the bug

I have the following folder structure:

  • service1
  • shared1
  • shared2

service1 requires all secrets stored in the service1 folder. It also requires some secrets from shared1 and some secrets from shared2. I added the shared tag to the secrets that are shared with service1.

To start service1, I use:

infisical run --path="/service1" --tags=shared -- node

This only imports the secrets from the service1 folder, but not any of the secrets tagged with shared.

To Reproduce

Steps to reproduce the behavior:

  1. Add a service1 folder at the root with a secret in it
  2. Add a shared1 folder at the root with two secrets in it. Tag one secret with shared.
  3. Add a shared2 folder at the root with two secrets in it. Tag one secret with shared.
  4. Run infisical run --path="/service1" --tags=shared -- node
  5. Notice that only one secret is available, the one from service1 and neither of the shared secrets.

Expected behavior

3 secrets are available.

  • One from service1
  • One from shared1
  • One from shared2

Screenshots

N/A

Platform you are having the issue on: Mac

Additional context

This happens in project 3ffa4095-f4aa-4440-bfc0-fe6fa86f8493.

@mikenikles
Copy link
Author

Oh hold on, TagSlugs is commented out here and for other functions for that matter. This happened a year ago though 🤔. Does nobody use tags or is it a user error on my side 😅?!

@ngoyal16
Copy link

ngoyal16 commented Jun 20, 2024

@mikenikles we also facing same issue.

@mikenikles
Copy link
Author

I followed up with the team shortly after my last comment above and they said they'd work on this in the next sprint. Hoping that'll still happen because it's the only deal breaker at the moment for me.

@mikenikles
Copy link
Author

@mikenikles
Copy link
Author

Here's a video walkthrough of my setup and what I see in the CLI.

infisical-secrets.mov

@maidul98
Copy link
Collaborator

maidul98 commented Aug 2, 2024

Hey @mikenikles , this was removed because filtering used to happen on client side. We'll need to add support for filtering with tags via API so that it can be properly filtered by clients such as CLI. We'll provide updates once that is added here

@mikenikles
Copy link
Author

Thanks for looking into that and providing an update.

I'll filter client-side for now as a workaround. If you have beta CLI releases let me know, happy to help test it once it's ready.

@maidul98
Copy link
Collaborator

maidul98 commented Aug 8, 2024

Once this PR is released @mikenikles, your issue should be addressed #2242

@akhilmhdh
Copy link
Member

@mikenikles Imported secrets cannot be filtered by tags at the moment. The above PR will tag all the secrets in a path thought

@mikenikles
Copy link
Author

Awesome, thanks guys for your help. I'll keep an eye on the next release and will report back once I've had a chance to test it.

@mikenikles
Copy link
Author

Is there potentially a backend change that needs to be rolled out besides the CLI version 0.28.5?

The results I see with 0.28.5 are the same as before where the --tags CLI flag didn't work.

platform on  main [!]
❯ infisical -v
infisical version 0.28.5

platform on  main [!]
❯ infisical --log-level info run --path="/platform/packages/website" --tags="shared" -- node -e "console.log(process.env.SHARED_ONE); console.log(process.env.WEBSITE_ONE); console.log(process.env.WEBSITE_TWO); console.log(process.env.NOT_SHARED_TWO)"
4:59PM INF Injecting 0 Infisical secrets into your application process
undefined
undefined
undefined
undefined

platform on  main [!]
❯ infisical --log-level info run --tags="shared" -- node -e "console.log(process.env.SHARED_ONE); console.log(process.env.WEBSITE_ONE); console.log(process.env.WEBSITE_TWO); console.log(process.env.NOT_SHARED_TWO)"
4:59PM INF Injecting 0 Infisical secrets into your application process
undefined
undefined
undefined
undefined

platform on  main [!]
❯ infisical --log-level info run --path="/platform/packages/website" -- node -e "console.log(process.env.SHARED_ONE); console.log(process.env.WEBSITE_ONE); console.log(process.env.WEBSITE_TWO); console.log(process.env.NOT_SHARED_TWO)"
4:59PM INF Injecting 2 Infisical secrets into your application process
undefined
W1
W2
undefined

Any command that includes --tags results in 0 secrets injected.

@akhilmhdh
Copy link
Member

Yes you also need to update the backend

@mikenikles
Copy link
Author

Oh, I use app.infisical.com :). I was wondering if the backend change is already deployed in the Infisical prod environment.

@mikenikles
Copy link
Author

I tested again with the v0.30.0 CLI release, but any command that includes --tags="..." still injects 0 secrets. Are you guys able to reproduce the issue based on my video and see the correct secrets injected?

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

No branches or pull requests

4 participants