infisical: support secrets within paths for data references#4305
infisical: support secrets within paths for data references#4305Skarlso merged 2 commits intoexternal-secrets:mainfrom
data references#4305Conversation
ab735bc to
a2234f0
Compare
|
Hi @lgo That was quick. Code wise looking good to me. I'll do the application test today and give my approval on my side. One small issue is, can we bring back the secret path option. Removing it would be a breaking change and want to keep it backward compatible. Simply keep that option as it is and if user provides it and not |
Sounds good. We could also just keep |
b54cfb2 to
5a3da95
Compare
|
I decided to just avoid adding/changing |
|
@lgo Hello 👋 Could you please sign your commits? :) |
fc5f5e2 to
dba1c01
Compare
|
Done! Sorry, I was away on a trip. I have not yet had a chance to build out the e2e tests either. Hi @akhilmhdh - just checking if you had any additional testing you'd like to do on your end before checking off? |
|
Is this now ready for review? |
|
Yep! |
|
|
Hi @Skarlso @gusfcarvalho @lgo I don't have push access to this branch. Can I make the changes requested as another PR with your commits to make this merged, if @lgo doesn't have time to continue working on it? We would love to see this changes getting shipped. |
|
As long as you’re fork from @lgo repo, so his contributions thus far are correctly accredited to him, I’m up for it 😄 |
|
Heh, yea - sorry this went stale! I haven't had a lot of spare time lately and I've worked around this by using a custom build that included this patch. Do feel free to fork this to take it over the finish line (if you don't get to it by EOW, I do have a long weekend that I can likely come back and rebase + address those) |
|
(actually, I'll go ahead and handle the rebase right now as I already had a rebased branch and roll in the existing PR feedback just to leave a slightly cleaner slate, whether or not there's further work needed) |
7affeca to
844a048
Compare
|
Okay I've pushed up a rebase, squashed the commits down, and addressed the one feedback. Two things that still need to be done:
I'll take a pass at this later tonight, or tomorrow morning, and see if I can wrap these items up. |
Any updates on this? I really prefer using |
|
Hi @typedrat! If you can take the remaining points from these commits and push your contribution to it, I’d gladly review it! otherwise, chances are this might go stale just because that’s the nature of community driven effort 🤷🏽♂️ |
Fair enough, I know how open source goes haha I don't know Go and I've only got the barest bit of experience with using Infisical's API, so I don't know if I'm really the one to get this over the finish line myself, but I'll come back and look at this when I'm out of my work crunch if no one else has picked this up. |
|
@typedrat I'll take a look. :) |
f3d624c to
f989b34
Compare
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com> On-behalf-of: Joey Pereira
f989b34 to
ac8ea21
Compare
Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
|
I had to rebase to get the signed commit to work, but I left an |
|
|
Thanks @Skarlso for your work 👍 |



(cc @akhilmhdh)
Problem Statement
When attempting to access a secret in a directory, provided
secretsPath: /, like so:This will always result in a 404 API error from Infisical, because the API request is malformed (
/api/v3/secrets/raw/foo/bar). The correct API request would instead be/api/v3/secrets/raw/bar?secretPath=/foo. This either:datapath, which isn't very usable or very obviousIn combination with #4059, this would result in empty secrets but after that issue is fixed these would fail to sync with an error.
Overall this was also quite confusing with the
SecretStore'ssecretsPathproperty - would aremoteRefbe an additive path? Would it supercede theSecretStore?Related Issue
Fixes #4298
Proposed Changes
As suggested on the issue (#4298 (comment)) this makes a particular changes:
remoteRef's with paths take precedence over anysecretsPathon theSecretStoreremoteRefis detected to be a path (i.e. it contains/), an error is raised if it does not start with/with an actionable error indicating to use/and that it is an absolute reference. This should hopefuly further clarify the interaction between this, andsecretsPathI've tested this against a self-hosted Infisical instance. I used a branch rebased off of #4304 to test this (lgo:joey-infisical-folder-handling-testing)
remoteRef: {key: "foo/bar"}ExternalSecretexpectedly fails witha secret key referencing a folder must start with a '/' as it is an absolute path, key: foo/barremoteKey: {key: "/foo/bar"}TODO:
Checklist
git commit --signoffmake testmake reviewable