Commit Graph

8 Commits

Author SHA1 Message Date
Ammar Bandukwala 2bd6d2908e
feat: convert entire CLI to clibase (#6491)
I'm sorry.
2023-03-23 17:42:20 -05:00
Ammar Bandukwala f7c10adb04
feat(cli): extract tar in template pull (#6289) 2023-02-22 19:29:51 +00:00
Ammar Bandukwala f05609b4da
chore: format Go more aggressively 2023-02-18 18:32:09 -06:00
Jon Ayers 90f77a3415
feat: add groups support to the CLI (#4755) 2022-10-27 16:49:35 -05:00
Jon Ayers 4e57b9fbdc
fix: allow regular users to push files (#4500)
- As part of merging support for Template RBAC
  and user groups a permission check on reading files
  was relaxed.

  With the addition of admin roles on individual templates, regular
  users are now able to push template versions if they have
  inherited the 'admin' role for a template. In order to do so
  they need to be able to create and read their own files. Since
  collisions on hash in the past were ignored, this means that a regular user
  who pushes a template version with a file hash that collides with
  an existing hash will not be able to read the file (since it belongs to
  another user).

  This commit fixes the underlying problem which was that
  the files table had a primary key on the 'hash' column.
  This was not a problem at the time because only template
  admins and other users with similar elevated roles were
  able to read all files regardless of ownership. To fix this
  a new column and primary key 'id' has been introduced to the files
  table. The unique constraint has been updated to be hash+created_by.
  Tables (provisioner_jobs) that referenced files.hash have been updated
  to reference files.id. Relevant API endpoints have also been updated.
2022-10-13 18:02:52 -05:00
Spike Curtis 184f0625e1
coder licenses add CLI command (#3632)
* coder licenses add CLI command

Signed-off-by: Spike Curtis <spike@coder.com>

* Fix up lint

Signed-off-by: Spike Curtis <spike@coder.com>

* Fix t.parallel call

Signed-off-by: Spike Curtis <spike@coder.com>

* Code review improvements

Signed-off-by: Spike Curtis <spike@coder.com>

* Lint

Signed-off-by: Spike Curtis <spike@coder.com>

Signed-off-by: Spike Curtis <spike@coder.com>
2022-08-23 13:55:39 -07:00
Jon Ayers 4b6189c9e9
fix: fix panic in template pull (#2710) 2022-06-28 19:54:28 -05:00
Jon Ayers 9b3b6418a2
feat: Add template pull cmd (#2329) 2022-06-15 12:42:43 -05:00