#New error!!
1 messages Ā· Page 1 of 1 (latest)
@spiral stream, what's the latest version of the code you're running? Just want the function signature if you can paste here.
signature
async def get_secret_plaintext(name: str, token: dagger.Secret, env: str, path: str) -> str
whole thing
@function
async def get_secret_plaintext(name: str, token: dagger.Secret, env: str, path: str) -> str:
print(await token.plaintext())
inf_client = InfisicalClient(token=await token.plaintext())
return inf_client.get_secret(name, environment=env, path=path)
@languid bridge š
I just tried to wrap this function with a Go module. Got same underlying errors, it looks like. Might be localized in the Python SDK?
import dagger
from dagger import function
@function
async def rat(secret: dagger.Secret) -> str:
return await secret.plaintext()
$ FOO=bar dagger call rat --secret=env:FOO
ā dagger call rat [0.64s]
ā bar
⢠Engine: 6a11f2242af8 (version devel ())
ā§ 2.37s ā 141 ā
37
Where is SecretBundle coming from (in your error message)? Is that from InfisicalClient?
No idea. Maybe so. I'll push up a branch
$ dagger call get-secret --name=DATABASE_URL --env=dev --path=/ --token=env:INF plaintext
ā dagger call get-secret plaintext [3.43s]
ā mongodb+srv://${DB_USERNAME}:${DB_PASSWORD}@mongodb.net
⢠Engine: 6a11f2242af8 (version devel ())
ā§ 5.19s ā 152 ā
37
I'm using a dev build btw.
No changes to your function.
Do you still get the same error? Which version?
Oh wait, I cloned from main I think.
Ok, now I can reproduce.
Yeah, it's get_secret_plaintext
The thing is that inf_client.get_secret() returns an object. Notice in get_secret you use .secret_value to extract the value from that object. But not in get_secret_plaintext.
- return inf_client.get_secret(name, environment=env, path=path)
+ return inf_client.get_secret(name, environment=env, path=path).secret_value