Commit Graph

2058 Commits

Author SHA1 Message Date
d52bc91e48 chore: add dbauthz to unhanger tests (#14394) 2024-08-22 22:23:52 +04:00
c818b4ddd4 feat: add notification for suspended/activated account (#14367)
* migrations

* notify

* fix

* TestNotifyUserSuspended

* TestNotifyUserReactivate

* post merge

* fix escape

* TestNotificationTemplatesCanRender

* links and events

* notifyEnq

* findUserAdmins

* notifyUserStatusChanged

* go build

* your and admin

* tests

* refactor

* 247

* Danny's review
2024-08-22 13:52:25 +02:00
e8c59a1d9d chore: avoid flake in resume token test (#14378) 2024-08-22 13:27:43 +10:00
a359879af5 chore: scope workspace quotas to organizations (#14352)
* chore: scope workspace quotas to organizations

Quotas are now a function of (user_id, organization_id). They are
still sourced from groups. Deprecate the old api endpoint.
2024-08-21 09:25:20 -05:00
fa733318e0 Add missing content (#14380) 2024-08-21 12:46:11 +00:00
6960d194ae feat: add provisioning timings to understand slow build times (#14274) 2024-08-21 14:18:58 +02:00
9c8c6a952d feat: add notification deduplication trigger (#14172) 2024-08-21 11:18:03 +02:00
b6d35edebd chore: remove meticulous from CI (#14369) 2024-08-20 14:13:13 -04:00
cca4519420 feat: enable setting max port share level during template creation (#14366) 2024-08-20 22:48:39 +10:00
cf8be4eac5 feat: add resume support to coordinator connections (#14234) 2024-08-20 17:16:49 +10:00
10327fb3a9 fix(coderd): humanize duration on notifications (#14333) 2024-08-19 15:49:47 -03:00
422e044859 chore: forbidden error on create workspace without permissions (#14347)
Multi-org enables the possibility of a user having template permissions,
but not workspace create permissions. The unauthorized error should be
returned instead of a 404. This does not leak any information the user
cannot already obtain.
2024-08-19 13:28:27 -05:00
95a7c0c4f0 chore: use tabs for prettier and biome (#14283) 2024-08-15 14:53:53 -06:00
7b09d98238 chore: add /groups endpoint to filter by organization and/or member (#14260)
* chore: merge get groups sql queries into 1

* Add endpoint for fetching groups with filters
* remove 2 ways to customizing a fake authorizer
2024-08-15 13:40:15 -05:00
83ccdaa755 chore: fixup quotas to only include groups you are a member of (#14271)
* chore: fixup quotas to only include groups you are a member of

Before all everyone groups were included in the allowance.

* chore: add unit test to execercise the bug
* add unit test to add rows into the everyone group
2024-08-15 13:27:50 -05:00
8563b372e8 feat: filter templates by organization (#14254) 2024-08-14 15:01:45 -06:00
4fc047954e fix: avoid deleting peers on graceful close (#14165)
* fix: avoid deleting peers on graceful close

- Fixes an issue where a coordinator deletes all
  its peers on shutdown. This can cause disconnects
  whenever a coderd is redeployed.
2024-08-14 15:16:08 -04:00
6f1951e1c8 feat: add template delete notification (#14250) 2024-08-14 14:22:43 -03:00
c90e6d7b47 chore: fix up migration number fixer (#14266) 2024-08-14 11:05:03 +02:00
84fdfd2a18 chore: remove UpsertCustomRole in favor of Insert + Update (#14217)
* chore: remove UpsertCustomRole in favor of Insert + Update

---------

Co-authored-by: Jaayden Halko <jaayden.halko@gmail.com>
2024-08-13 12:53:47 -05:00
6f9b1a39f4 fix: allow group members to read group information (#14200)
* - allow group members to read basic Group info
- allow group members to see they are part of the group, but not see that information about other members
- add a GetGroupMembersCountByGroupID SQL query, which allows group members to see members count without revealing other information about the members
- add the group_members_expanded db view
- rewrite group member queries to use the group_members_expanded view
- add the RBAC ResourceGroupMember and add it to relevant roles
- rewrite GetGroupMembersByGroupID permission checks
- make the GroupMember type contain all user fields
- fix type issues coming from replacing User with GroupMember in group member queries
- add the MemberTotalCount field to codersdk.Group
- display `group.total_member_count` instead of `group.members.length` on the account page
2024-08-13 09:20:24 -05:00
76722a7db5 fix: make default support links respect --docs-url (#14176)
make default support links respect --docs-url
2024-08-12 17:01:22 -04:00
8af8c77e2a test: add unit test to verify group permission behavior (#14223)
* test: add unit test to verify group permission behavior
* Update coderd/database/dbauthz/groupsauth_test.go

---------

Co-authored-by: Cian Johnston <cian@coder.com>
2024-08-12 08:34:00 -05:00
21942afef3 feat(site): implement notification ui (#14175) 2024-08-09 13:43:09 -03:00
591385f2ca chore: implement fuzzy name matching for templates (#14211)
* chore: add fuzzy name search for templates
* chore: implement fuzzy name matching for templates

Templates search query defaults to a fuzzy name match
2024-08-09 10:21:26 -05:00
27b8f201a4 refactor: refactor notification email template (#14208) 2024-08-09 11:25:19 -03:00
2c13797350 chore: implement deleting custom roles (#14101)
* chore: implement deleting custom roles

* add trigger to delete role from organization members on delete
* chore: add comments to explain populated field
2024-08-07 12:37:55 -05:00
c6076d2d0d chore: improve notification template tests' resilience (#14196) 2024-08-07 11:33:26 +02:00
ff785588fe chore: don't require an organization to read starter templates (#14190) 2024-08-06 11:26:26 -06:00
fab196043e fix: allow tag removal in provisioner upsert (#14187) 2024-08-06 11:38:55 -04:00
58428aafce fix: allow all users to read system notification templates (#14181) 2024-08-06 15:37:49 +02:00
70a694ed4c fix: document files API needs ustar format (#14152)
Signed-off-by: Spike Curtis <spike@coder.com>
2024-08-06 11:00:49 +04:00
0ad5f6067d chore: prevent removing members from the default organization (#14094)
* chore: prevent removing members from the default organization

Until multi-organizations is released outside an experiment, the
experiment should be backwards compatible.
2024-08-05 13:48:10 -05:00
173dc0e35f chore: refactor patch custom organization route to live in enterprise (#14099)
* chore: refactor patch custom organization route to live in enterprise
2024-08-05 13:42:11 -05:00
a77a9ab0a6 chore: skip audit log filter for owner/admin users (#14132)
* chore: audit log filter to be skipped if user is owner/admin

Optimize for speed in the case the user can read all audit_logs

* fixup! chore: audit log filter to be skipped if user is owner/admin
2024-08-05 13:42:01 -05:00
b80d99550a chore: revert status code change for delete users endpoint (#14168)
Revert from https://github.com/coder/coder/pull/13870
2024-08-05 13:10:56 -05:00
4e0cb60eeb fix: ignore errors on provided logger (#14169) 2024-08-05 17:22:34 +00:00
f9b660e573 fix: ignore coderd log errors (#14166)
- This is the source of a lot of our flakes recently.
2024-08-05 12:07:06 -04:00
e164b1e71c feat: add notification preferences database & audit support (#14100) 2024-08-05 16:18:45 +02:00
166467caf0 fix: don't require organization_id in body when updating a custom role (#14102) 2024-08-02 11:25:00 -06:00
6e36082b0f chore: add github.com user id association (#14045)
* chore: add github.com user id association

This will eventually be used to show an indicator in the UI
to star the repository if you've been using Coder for a while
and have not starred the repo.

If you have, we'll never show a thing!

* gen

* Fix model query

* Fix linting

* Ignore auditing github.com user id

* Add test

* Fix gh url var name

* Update migration

* Update coderd/database/dbauthz/dbauthz.go

Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>

* Fix updating to when the token changes

* Fix migration

---------

Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>
2024-08-02 12:49:36 -04:00
6428a766a9 feat: notify when a user account is deleted (#14113) 2024-08-02 14:56:54 +02:00
4242fd9c1b fix: wrong notification group (#14112) 2024-08-02 10:00:27 +00:00
76ce460cc4 fix: typo in notification template (#14108) 2024-08-02 11:03:11 +02:00
a27ac30e11 chore: add sql filter to fetching audit logs (#14070)
* chore: add sql filter to fetching audit logs
* use sqlc.embed for audit logs
* fix sql query matcher
2024-08-01 12:07:19 -05:00
956d0cb042 fix: block creating oidc users when oidc has not been configured (#14064) 2024-08-01 13:30:10 +10:00
bf4b7abf14 chore(coderd): allow creating workspaces without specifying an organization (#14048) 2024-07-30 10:44:02 -06:00
cf1fcab514 feat: notify about created user account (#14010) 2024-07-30 15:37:45 +02:00
3209c863b8 chore: authz 'any_org' to return if at least 1 org has perms (#14009)
* chore: authz 'any_org' to return if at least 1 org has perms

Allows checking if a user can do an action in any organization,
rather than a specific one. Allows asking general questions on the
UI to determine which elements to show.

* more strict, add comments to policy
* add unit tests and extend to /authcheck api
* make field optional
2024-07-29 19:58:48 -05:00
58b810fb0a fix: fix dormancy notifications (#14029) 2024-07-29 11:20:04 -03:00