Hi folks! I want to create a custom GeneratingCommand that makes a simple API request, but how do I save the API key in passwords.conf? I have a default/setup.xml file with the following content: <setup>
<block title="Add API key(s)" endpoint="storage/passwords" entity="_new">
<input field="password">
<label>API key</label>
<type>password</type>
</input>
</block>
</setup> But when I configure the app, the password (API key) is not saved in the app folder (passwords.conf). And if I need to add several api keys, how can I assign names to them and get information from the storage? I doubt this code will work: try:
app = "app-name"
settings = json.loads(sys.stdin.read())
config = settings['configuration']
entities = entity.getEntities(['admin', 'passwords'], namespace=app, owner='nobody', sessionKey=settings['session_key'])
i, c = entities.items()[0]
api_key = c['clear_password']
#user, = c['username'], c['clear_password']
except Exception as e:
yield {"_time": time.time(), "_raw": str(e)}
self.logger.fatal("ERROR Unexpected error: %s" % e)
... View more