Skip to content

User management via API and console #574

Closed

Description

@gramian

Currently the console has no means of creating or deleting a user. Following is a proposal for console commands.

Expected behavior

  • CREATE USER username IDENTIFIED BY password
  • DROP USER username

For the HTTP-API endpoints this could translate to:

  • create user: api/v1/user/username

Given the server-only users, I think it would make sense to constrain these commands to the console, as for the CREATE DATABASE and DROP DATABASE commands?

Activity

  1. lvca commented on Dec 8, 2022

    @lvca
    Member

    Ref from #661.

  2. self-assigned this
    on Dec 8, 2022
  3. added this to the 22.12.1 milestone on Dec 8, 2022
  4. added
    enhancement
    on Dec 8, 2022
  5. lvca commented on Dec 8, 2022

    @lvca
    Member

    I'm going to work on this soon. I believe supporting the console should be quick with the syntax @gramian proposed.

  6. lvca commented on Dec 9, 2022

    @lvca
    Member

    Ok, this is supported now.

    The console supports 2 new commands when connected to a remote server:

    create user <user-name> identified by <user-password> [grant connect to <db-name>*]

    The user password must be at least 5 characters and not more than 256 characters. Any character is fine but spaces.
    the list of databases must be separated by a comma in case multiple databases are provided.

    And

    drop user <user-name>

    On the server there are 2 new HTTP commands:

    POST /user where the payload is the JSON used by the command, it's already in the docs. Example:

    {"name":"elon","password":"musk","databases":{"*":["admin"]}}

    If databases field is not existent, then the user can access to any databases on the server like it was defining "databases":{"*":["admin"]}.

    To delete a user execute a HTTP:

    DELETE /user/{user-name}.

    Both HTTP commands require server authentication, you can use "root".

  7. lvca commented on Dec 9, 2022

    @lvca
    Member

    @gramian any help with the docs would be VERY appreciated :-)

  8. changed the title [-]User management via API or console[/-] [+]User management via API and console[/+] on Dec 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions