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

Cannot create admin-level AuthTokens and general clunkiness #506

Open
vaizki opened this issue Feb 2, 2023 · 1 comment
Open

Cannot create admin-level AuthTokens and general clunkiness #506

vaizki opened this issue Feb 2, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request stargazed

Comments

@vaizki
Copy link

vaizki commented Feb 2, 2023

When using the API to create new Aliases (to automatically add/remove Kubernetes Pods with sip-ports in the alias table), I discovered that you cannot from the GUI create an AuthToken that has admin privileges to do so.

When an AuthToken is created, it includes a dummy user object which is used in place of a real user object for API access. This user object is always the AgentObjectforAuthToken defined in the schema as:

var AgentObjectforAuthToken = json.RawMessage(`{
   "username": "test",
   "firstname": "Tester",
   "lastname": "Tester",
   "email": "tester@test.com",
   "usergroup": "user",
   "id": 1000,
   "partid": 10
  }`)

.. which seems a bit hack-ish. Especially since the usergroup is fixed to user and the only way to change it was to go and manually UPDATE the whole JSON in the DB.

Two proposals:

  1. patch it, allowing setting of usergroup (and editing?) in the included dummy user object (and change all the "Tester" stuff to "API" ..); OR
  2. rewrite it, allowing creation of API-only users (can't login) and instead of embedding the user object into the AuthToken just have the token point to the real API-only user.

Of course I would prefer option 2 as it would also allow setting of any user properties with the normal editor and not having to special-case every attribute that needs changing.

@kYroL01 kYroL01 added the enhancement New feature or request label Feb 2, 2023
@adubovikov
Copy link
Member

I think the first way is more flexible, but more dangerous from security view. Another proposal, can we put this like a settings to the homer-app application and replace it ? Similar like: "token-user", "token-group", or just add the full object inside ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stargazed
Projects
None yet
Development

No branches or pull requests

3 participants