Commit Graph

2275 Commits

Author SHA1 Message Date
8e06ad46d0 chore: add organization member api + cli (#13577) 2024-06-20 09:19:24 -05:00
e987ad1d89 fix: don't allow "new" or "create" as url-friendly names (#13596) 2024-06-18 15:36:13 -06:00
3a1fa04590 fix: write server config to telemetry (#13590)
* fix: add external auth configs to telemetry

* Refactor telemetry to send the entire config

* gen

* Fix linting
2024-06-18 16:20:21 -04:00
44d69139d5 chore: accept payload on workspace usage route (#13544) 2024-06-14 10:08:45 -04:00
fe240add86 fix(coderd): userOIDC: ignore leading @ of EmailDomain (#13568) 2024-06-14 09:29:07 +01:00
d04959cea8 chore: implement custom role assignment for organization admins (#13570)
* chore: static role assignment mapping

Until a dynamic approach is created in the database, only org-admins
can assign custom organization roles.
2024-06-13 15:59:06 -05:00
3d30c8dc68 chore: protect reserved builtin rolenames (#13571)
Conflicting built-in and database role names makes it hard to
disambiguate
2024-06-13 15:12:37 -05:00
0268c7a659 chore: refactor autobuild/notify to use clock test (#13566)
Refactor autobuild/notify and tests to use the clock testing library.

I also rewrote some of the comments because I didn't understand them when I was looking at the package.
2024-06-13 16:01:17 +04:00
fc09077b7b feat!: add interface report to coder netcheck (#13562)
re: #13327

Adds local interfaces to `coder netcheck` and checks their MTUs for potential problems.

This is mostly relevant for end-user systems where VPNs are common.  We _could_ also add it to coderd healthcheck, but until I see coderd connecting to workspaces over a VPN in the wild, I don't think its worth the UX effort.

Netcheck results get the following:

```
  "interfaces": {
    "error": null,
    "severity": "ok",
    "warnings": null,
    "dismissed": false,
    "interfaces": [
      {
        "name": "lo0",
        "mtu": 16384,
        "addresses": [
          "127.0.0.1/8",
          "::1/128",
          "fe80::1/64"
        ]
      },
      {
        "name": "en8",
        "mtu": 1500,
        "addresses": [
          "192.168.50.217/24",
          "fe80::c13:1a92:3fa5:dd7e/64"
        ]
      }
    ]
  }
```

_Technically_ not back compatible if anyone is parsing `coder netcheck` output as JSON, since the original output is now under `"derp"` in the output.
2024-06-13 10:19:36 +04:00
d0fc81a51c chore: implement cli list organization members (#13555)
example cli command: 
`coder organization members`
2024-06-12 10:07:12 -10:00
bbe23edc7d chore: implement api layer for listing organization members (#13546) 2024-06-12 09:52:18 -10:00
de9e6889bb chore: merge organization member db queries (#13542)
Merge members queries into 1 that also joins in the user table for username.
Required to list organization members on UI/cli
2024-06-12 09:23:48 -10:00
28228f1bcb feat: allow editing org icon (#13547) 2024-06-12 12:28:13 -06:00
ba7d1835e5 fix: fix flake in TestWorkspaceAgent_Metadata_CatchMemoryLeak (#13553)
Fixes flake seen here: https://github.com/coder/coder/actions/runs/9461246505/job/26061605278

#13486 subtly changes the test so that `post` uses the new v2 Agent API, and when canceling context, there is a race condition where the yamux session underpinning the API can get torn down before the RPC processes the canceled context, yielding a different error response than the test was previously expecting.

I've refactored the test to just stop posting when the test finishes, rather than depend on a context cancel to end the posting goroutine.
2024-06-12 18:33:22 +04:00
5ccf5084e8 chore: create type for unique role names (#13506)
* chore: create type for unique role names

Using `string` was confusing when something should be combined with
org context, and when not to. Naming this new name, "RoleIdentifier"
2024-06-11 08:55:28 -05:00
c9cca9d56e fix: transform underscores to hyphens for github login (#13384)
Fixes #13339.
2024-06-11 13:34:05 +00:00
dd243686e4 chore!: remove deprecated agent v1 routes (#13486) 2024-06-11 12:22:59 +10:00
5b9a65e5c1 chore: move Batcher and Tracker to workspacestats (#13418) 2024-06-10 15:35:23 -04:00
8326a3a675 chore: change mock clock to allow Advance() within timer/tick functions (#13500) 2024-06-10 15:27:24 +04:00
0d65143301 chore: implement audit log for custom role edits (#13494)
* chore: implement audit log for custom role edits
2024-06-07 14:11:57 -05:00
48ecee1025 chore(cli): address cli netcheck test flake (#13492)
* netcheck: removes check for healthy node report in test
* coderd/healthcheck/derphealth: do not override parent context deadline
2024-06-07 10:01:54 +01:00
7c3b8b6224 chore: duplicate migration file fix, 000216 (#13498) 2024-06-06 16:13:00 -05:00
e2b330fcba chore: change sql parameter for custom roles to be a (name,org_id) tuple (#13480)
* chore: sql parameter to custom roles to be a (name,org) tuple

CustomRole lookup takes (name,org_id) tuples as the search criteria.
2024-06-06 15:36:37 -05:00
44a70a5bc2 feat: edit org display names and descriptions (#13474) 2024-06-06 10:59:59 -06:00
1131772e79 feat(coderd): set full name from IDP name claim (#13468)
* Updates OIDC and GitHub OAuth login to fetch set name from relevant claim fields
* Adds CODER_OIDC_NAME_FIELD as configurable source of user name claim
* Adds httpapi function to normalize a username such that it will pass validation
* Adds firstName / lastName fields to dev OIDC setup
2024-06-06 13:37:08 +01:00
8f62311f00 chore: remove organization_id suffix from org_member roles in database (#13473)
Organization member's table is already scoped to an organization.
Rolename should avoid having the org_id appended.

Wipes all existing organization role assignments, which should not be used anyway.
2024-06-05 11:25:02 -05:00
fade8ba759 fix: fix MeasureLatencyRecvTimeout to accept send=0 (#13477)
Fixes the flake seen here: https://github.com/coder/coder/runs/25832852690

Linux is not a real time operating system, and so there is no guarantee that subsequent `time.Now()` `time.Since()` calls will return a non-zero time.  This assert is mainly there to ensure we don't return `-1`.
2024-06-05 18:27:56 +04:00
9c3fd5dd26 chore: add explicit Wait() to clock.Advance() (#13464) 2024-06-05 15:37:16 +04:00
42324b386a chore: add clock pkg for testing time (#13461)
Adds a package for testing time/timer/ticker functions.  Implementation is limited to `NewTimer` and `NewContextTicker`, but will eventually be expanded to all `time` functions from the standard library as well as `context.WithTimeout()`, `context.WithDeadline()`.

Replaces `benbjohnson/clock` for the pubsub watchdog, as a proof of concept.

Eventually, as we expand functionality, we will replace most time-related functions with this library for testing.
2024-06-05 13:55:45 +04:00
e3206612e1 chore: implement typed database for custom permissions (breaks existing custom roles) (#13457)
* chore: typed database custom permissions
* add migration to fix any custom roles out there
2024-06-04 09:27:44 -05:00
168d2d6ba0 chore(coderd): add update user profile test for members (#13463) 2024-06-04 14:17:17 +01:00
cd32c42699 fix(cli): inherit provisioner tags from last template version (#13462) 2024-06-04 11:59:54 +00:00
40390ecc30 chore: fix TestServer/Prometheus/DBMetricsDisabled test flake (#13453)
See: https://github.com/coder/coder/actions/runs/9352137263/job/25739550487#step:5:368
2024-06-03 15:38:59 -05:00
e4ac691468 chore: fix (*coderdtest.WorkspaceAgentWaiter).Wait() flake (#13451) 2024-06-03 14:46:56 -05:00
27f26910b6 chore: external auth validate response "Forbidden" should return invalid, not an error (#13446)
* chore: add unit test to delete workspace from suspended user
* chore: account for forbidden as well as unauthorized response codes
2024-06-03 13:16:51 -05:00
9d00a26a90 fix: add missing route for codersdk.PostLogSource (#13421) 2024-06-03 12:29:50 -05:00
973cc2b875 chore: add edit organization role to cli (#13365)
Editing custom org roles from hidden org cli command.
2024-06-03 09:34:10 -05:00
24ba81930b chore: return failed refresh errors on external auth as string (was boolean) (#13402)
* chore: return failed refresh errors on external auth

Failed refreshes should return errors. These errors are captured
as validate errors.
2024-06-03 09:33:49 -05:00
bf98b0dfe4 fix: correct swagger description for Insights API (#13442) 2024-06-03 15:48:31 +02:00
b248f125e1 chore: rename notification banners to announcement banners (#13419) 2024-05-31 10:59:28 -06:00
de8149fbfd chore: move template meta last_used_at update to workspacestats (#13415) 2024-05-31 12:26:19 -04:00
5789ea5397 chore: move stat reporting into workspacestats package (#13386) 2024-05-29 11:49:08 -04:00
afd9d3b35f feat: add api for patching custom org roles (#13357)
* chore: implement patching custom organization roles
2024-05-29 09:49:43 -05:00
cca3cb1c55 feat(provisioner): pass owner git ssh key (#13366) 2024-05-29 11:43:08 +01:00
79d73f77f5 chore: skip Azure TestExpiresSoon (#13385)
Adds some context to the test skip so it can be removed or enabled in the future.
2024-05-28 16:45:41 +00:00
e5bb0a7a00 chore: add easy NAT integration tests part 2 (#13312) 2024-05-24 16:32:30 +10:00
1b4ca00428 chore: include custom roles in list org roles (#13336)
* chore: include custom roles in list org roles
* move cli show roles to org scope
2024-05-23 07:54:59 -10:00
b43344b672 feat: use latest gVisor and go 1.22.3 (#13338) 2024-05-23 08:22:44 -04:00
c2837a62e4 feat: evaluate provisioner tags (#13333) 2024-05-23 07:53:51 +00:00
3f1e9c038a feat(coderd): add endpoints for editing and deleting organizations (#13287) 2024-05-21 12:46:31 -06:00