Closed gavinelder closed 2 years ago
As @gavinelder pointed out in py3 it uses input()
while py2 uses raw_input()
, but they should behave the same to read the user input as a string which is the keyfile path
in our case. Later, we should read the content of the keyfile
using _required_auth_info
classmethod https://github.com/airbnb/streamalert/blob/a0a284c6bfdb9de40e76fc7581627b5863445cc0/streamalert/apps/_apps/gsuite.py#L200-L227
Definitely there is something wrong when calls _required_auth_info
or it may not be called. Will investigate more.
To add more context about @gavinelder 's issue, the value of gsuite_token_gtoken_app_auth
should be a json blob containing the context of private key. However, instead of storing the context of private key, it stores the path to the private key file which is wrong.
Opened a PR to address this, was forced to spend more time than a quick glance as part of building a new app.
Background
Currently in
streamalert_cli/helpers.py
there is a function calleduser_input
historicallyuser_input
used python2raw_input
and as part of callingresponse_is_valid
called a validation function which returned a string.This string would then replace the contents of
raw_input()
overriding the user inputed string.In the later releases of StreamAlert and migration to python3 it appears that
input()
is no longer having the value manipulated in the same way.Description
Steps to Reproduce
On a StreamAlert 3.0+ release create a new application such as
gsuite
orbox
which utilise this value returned by the validation function, once the application is created go to parameter store and look at the contents you should see the String to the path on disk vs the file contents.Desired Change
Contents of the file on disk to be stored in parameter store.