PYTHON Reading Secret INPUT
The INPUT_SCHEMA now support SECRET Input:
https://docs.apify.com/actors/development/secret-input#encryption-mechanism
Is there any example to read this Secret INPUT in PYTHON ?
Thanks.
Apify
Secret input ยท Apify Documentation
Learn about making some actor input fields secret and encrypted. Ideal for passing passwords, API tokens or login cookies to actors.
9 Replies
@thek1tten @pczr @Lukas Krivka @Alexey Udovydchenko ๐ป
cloudy-cyanโข3y ago
Looking into it!
Currently looking at how they do it in the JS Apify SDK - https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/actor.ts#L655
Seems like there are some environment variables containing the secrets encryption key: https://github.com/apify/apify-sdk-js/blob/master/packages/apify/src/configuration.ts#L134
Thanks! so far my actors just use no other than
import ApifyClient
๐cloudy-cyanโข3y ago
Yup! Just backtracking what we do in the JS SDK to find out how to re-implement it in Python ๐
Let me pass this over to @Alexey Udovydchenko, he might be able to help you further
Thanks!
I found https://github.com/apify/apify-shared-js/blob/master/packages/input_secrets/src/input_secrets.ts is this related ?
cloudy-cyanโข3y ago
Yes
Not sure if its viable since we need python version of https://github.com/apify/apify-shared-js/blob/master/packages/utilities/src/crypto.ts compatible with https://nodejs.org/en/knowledge/cryptography/how-to-use-crypto-module/
Perhaps consider alternative integration with Zapier of Make, i.e. zaps are shareable by URL and you can provide input template with actor run at second step
Thanks. its to complicated for me ๐คฃ I guess I will stick with plain unencrypted password for now
Totally understand, I think its overkill to redo python version