Skip to content
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

"Create individual user" Route for internal API #877

Closed
jeremy-london opened this issue Oct 15, 2020 · 2 comments
Closed

"Create individual user" Route for internal API #877

jeremy-london opened this issue Oct 15, 2020 · 2 comments
Labels

Comments

@jeremy-london
Copy link
Contributor

Our instance will not have team based competitions but will be individual members.

I want to be able to add a user programmatically through the internal API that mimics the "Add Users" section of the UI.

API would allow creation of new user with username/password and optionally assign to a team, if no team matches the requested team than auto-create the team

Additional context

Currently it looks like the only way to accomplish this is to script together the user/teams API and the user/accounts API to create a team with the user/teams API, then add a user with the user/accounts API.

@eldering eldering added the API label Oct 17, 2020
@nickygerritsen
Copy link
Member

Unlike the other import files, accounts.tsv is a bit strange: it is not directly linked to users:

  • Besides containing the role, the first field also determines whether we need to create a team or link it to an existing team.
  • If the role is team, the username field must be team-nnn with nnn a team number.

See https://ccs-specs.icpc.io/ccs_system_requirements#accountstsv for the format.
The other API endpoints do have JSON support based in the CCS specification API, and I have just created PR #942 that also allowd to add a single item directly instead of using a file.

My proposal is to create POST /api/users to create a new user, with our normal JSON structure, which then will add a user.
We can then also add GET /api/users and GET /api/users/<id>. All will only be allowed by admin's and omit passwords from the response.

Thoughts?

@jeremy-london
Copy link
Contributor Author

Awesome idea! I think that would solve it well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants