Added shared account selection module based on the old python API#64
Conversation
2904f12 to
523db63
Compare
| shared_submit_warning = """\ | ||
| You are submitting a resource from a shared account. | ||
| To suppress this message run: flow360 configure --suppress-shared-account-prompt | ||
| """ |
There was a problem hiding this comment.
I think the message should read:
You are submitting a resource to a shared account (email address).
There was a problem hiding this comment.
Fixed in 5035ff0 - the message is updated and confirmation now works per-session and needs to be performed only once until the user logs out, either interactively or by the user calling
fl.Accounts.confirm_submit()
|
|
||
| selected = None | ||
|
|
||
| addresses = [d["userEmail"] for d in company_users] |
There was a problem hiding this comment.
we try to avoid single letter variables, even in such instances. Use user instead
| user email to impersonate (if email exists among shared accounts), | ||
| if email is not provided user can select the account interactively | ||
| """ | ||
| company_users = self._get_company_users() |
There was a problem hiding this comment.
lets use a list that will have both company users and supported users. Supported in future. Suggest a name shared_accounts
| return wrapper | ||
|
|
||
|
|
||
| def confirm_proceed(): |
There was a problem hiding this comment.
rename function:
shared_account_confirm_proceed() or something similar to indicate that this confirmation is only in case of shared account
There was a problem hiding this comment.
Renamed to shared_account_confirm_submit() in 2e584f1
| level: LogValue = DEFAULT_LEVEL, | ||
| back_up_count: int = 10, | ||
| max_bytes: int = 10000, | ||
| max_bytes: int = 100000000, |
There was a problem hiding this comment.
why changing this again? Is it a conflict?
There was a problem hiding this comment.
Accidentally changed when running tests to speed up the process before merging with FLPY-35 fix. Reverting in next commit to prevent conflict.
fb447bd to
2e584f1
Compare
|
|
||
| return self._current_email | ||
|
|
||
| def leave_shared_account(self): |
There was a problem hiding this comment.
on leave, we should reset the submit confirm question
2e584f1 to
3441504
Compare
User can now change his account to one of the accounts shared with him (company and clients) while interacting with the backend. This can be done in one of two ways, by calling:
where the account will be switched if the provided email address exists and is shared with the current user or
where the user will be prompted to select an account from the list interactively.
When submitting resources to the server while using a shared account, the user is prompted to confirm the action:
This message shows once per session until the user logs out if the user confirms interactively or by calling
NOTE: Due to backend issues we currently do not support client accounts, as apikey authentication does not seem to work when requesting their data from the webapi. This will be fixed separately.