#New error!!

1 messages Ā· Page 1 of 1 (latest)

spiral stream
languid bridge
#

@spiral stream, what's the latest version of the code you're running? Just want the function signature if you can paste here.

spiral stream
#

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?

languid bridge
#
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?

spiral stream
#

No idea. Maybe so. I'll push up a branch

languid bridge
#
$ 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.

spiral stream
#

Yeah, it's get_secret_plaintext

languid bridge
#

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
spiral stream
#

awesome! Thank you!

#

I thought there was an issue with one thing...looking in wrong place