-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/password: Add password check on python side before passing to node for unlock #116
Conversation
…tting string return to the passphrase prompt
At first glance everything looks good! import time
import numpy as np
from bifrost import dcp
# INPUT SET
input_set = list("\"Un bon MOT ne prouve rien.\"")
# WORK FUNCTION
def work_function(character):
return character.upper()
# COMPUTE_FOR
job = dcp.compute_for(input_set, work_function)
# EXEC
result_set = job.exec(keystore_unlocked=True)
# DISPLAY RESULTS
print(''.join(result_set))\ properly deploys a job for a bank acct keystore that has an empty string password stlll looking into it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some notes / nitpicks. Not sure how important they are, feel free to dismiss them and I'll consider the MR good to go:
Is it expected for this code job["payment_account_password"]="123123"
to result in the following error:
TypeError: Job.__setitem__() takes 2 positional arguments but 3 were given
Not sure hows bifrost 1 handles dot vs key access for dict like objects - PythonMonkey conflates them which is maybe weirder. But I was also surprised to see this error
How do you set the password for a keystore whose password isn't the empty string? Or is that out of the scope of this mr. The following code doesn't work (I think as expected since the keystore is never unlocked?)
import time
import numpy as np
from bifrost import dcp
# INPUT SET
input_set = list("\"Un bon MOT ne prouve rien.\"")
# WORK FUNCTION
def work_function(character):
return character.upper()
# COMPUTE_FOR
job = dcp.compute_for(input_set, work_function)
# SET PASSWORD
job.payment_account_password="123123"
# EXEC
result_set = job.exec(keystore_unlocked=True)
# DISPLAY RESULTS
print(''.join(result_set))
I get the following output:
State : exec
Passphrase prompt may be hidden because stdout is not tty.
It gets stuck and never deploys. If I try to type the password it doesn't take it in
Do I just need to read it in and then pass it as job_payment_account
yes. You are not expected to set the payment_account_password manually or by code.
You should never set the password in plaintext on the job. Instead, try the following:
You'll automatically be asked for the password. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome LGTM!
This PR adds the capability for a user to be prompted for a passphrase. Note that a user will always be prompted even if the keystore given is passphraseless unless they specify the
keystore_unlocked=True
injob.exec
.