Skip to content

When to raise credentials dialog? #80

@benjamin-heasly

Description

@benjamin-heasly

@DavidBrainard and I discussed the question of when to raise the credentials dialog. That is, pop up a window and ask for a username and password.

We had some motivations from a user point of view.

If the user has complete credentials (ie both name and password) in their configuration JSON, then we should try not to bother them with a credentials dialog.

But, if the user has read-only credentials, like "guest", and they want to publish data, we might like to raise the credentials dialog anyway, so that they can type in write credentials. This would allow users to temporarily "un-guest" themselves during write operations.

It would be nice if we could ask the server what permissions a user has, like read vs write. Currently we can only ask if credentials are accepted, not what they are good for.

Current behaviors:

  • Raise the dialog when loading configuration in rdtConfiguration(), if there is a non-guest username but no password. Only checks whether credentials look complete, does not ask the server if the credentials are good.
  • Raise the dialog from RdtClient.credentialsDialog(), no matter what.
  • In rdtCredentialsDialog() itself, always raise the dialog at least once. Keep raising the dialog until the server accepts the credentials.
  • rdtPingServer() can check whether the server accepts a user's credentials, but not what permissions they might have.

Possible improvements:

  • Let rdtPingServer() ask for user details, like whether they have read or write permissions for the configured repository.
  • Let rdtCredentialsDialog() check with the server first, before raising the dialog. This would mean rdtCredentialsDialog() might not actually raise a dialog, depending on the configured credentials.
  • Let the behavior of rdtCredentialsDialog() depend on user details like read vs write permission. Perhaps:
    • rdtCredentialsDialog('when', 'always') -- raise dialog no matter what.
    • rdtCredentialsDialog('when', 'reading') -- raise dialog only if user lacks read permissions.
    • rdtCredentialsDialog('when', 'writing') -- raise dialog only if user lacks write permissions.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions