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
!!!Joefree!!! ๐Ÿ‘‘
!!!Joefree!!! ๐Ÿ‘‘OPโ€ข3y ago
@thek1tten @pczr @Lukas Krivka @Alexey Udovydchenko ๐Ÿป
cloudy-cyan
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
!!!Joefree!!! ๐Ÿ‘‘
!!!Joefree!!! ๐Ÿ‘‘OPโ€ข3y ago
Thanks! so far my actors just use no other than import ApifyClient ๐Ÿ˜†
cloudy-cyan
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
cloudy-cyan
cloudy-cyanโ€ข3y ago
Yes
Alexey Udovydchenko
Alexey Udovydchenkoโ€ข3y ago
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
!!!Joefree!!! ๐Ÿ‘‘
!!!Joefree!!! ๐Ÿ‘‘OPโ€ข3y ago
Thanks. its to complicated for me ๐Ÿคฃ I guess I will stick with plain unencrypted password for now
Alexey Udovydchenko
Alexey Udovydchenkoโ€ข3y ago
Totally understand, I think its overkill to redo python version

Did you find this page helpful?