Garrett Delfosse
b412cc1a4b
fix: use correct response writer for tracing middle ( #3693 )
2022-08-25 11:24:43 -05:00
Mathias Fredriksson
78a24941fe
feat: Add codersdk.NullTime, change workspace build deadline ( #3552 )
...
Fixes #2015
Co-authored-by: Joe Previte <jjprevite@gmail.com >
2022-08-25 19:10:42 +03:00
Spike Curtis
4de1fc8339
CLI: coder licenses list ( #3686 )
...
* Check GET license calls authz
Signed-off-by: Spike Curtis <spike@coder.com >
* CLI: coder licenses list
Signed-off-by: Spike Curtis <spike@coder.com >
Signed-off-by: Spike Curtis <spike@coder.com >
2022-08-25 08:24:39 -07:00
Garrett Delfosse
a05fad4efd
fix: stop tracing static file server ( #3683 )
2022-08-25 09:37:59 -04:00
Steven Masley
0b53b06fc6
chore: Make member role struct match site roles ( #3671 )
2022-08-24 15:58:57 -04:00
Spike Curtis
9e35793b43
Enterprise rbac testing ( #3653 )
...
* WIP refactor Auth tests to allow enterprise
Signed-off-by: Spike Curtis <spike@coder.com >
* enterprise RBAC testing
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix import ordering
Signed-off-by: Spike Curtis <spike@coder.com >
Signed-off-by: Spike Curtis <spike@coder.com >
2022-08-24 12:05:46 -07:00
Garrett Delfosse
5d7c4092ac
fix: end long lived connection traces ( #3679 )
2022-08-24 14:57:31 -04:00
Spike Curtis
c9bce19d88
GET license endpoint ( #3651 )
...
* GET license endpoint
Signed-off-by: Spike Curtis <spike@coder.com >
* SDK GetLicenses -> Licenses
Signed-off-by: Spike Curtis <spike@coder.com >
Signed-off-by: Spike Curtis <spike@coder.com >
2022-08-24 18:44:22 +00:00
Cian Johnston
eba753ba87
fix: template: enforce bounds of template max_ttl ( #3662 )
...
This PR makes the following changes:
- enforces lower and upper limits on template `max_ttl_ms`
- adds a migration to enforce 7-day cap on `max_ttl`
- allows setting template `max_ttl` to 0
- updates template edit CLI help to be clearer
2022-08-24 15:45:14 +01:00
Mathias Fredriksson
7a71180ae6
chore: Enable comments for database dump / models ( #3661 )
2022-08-24 12:44:30 +00:00
Jon Ayers
a7b49788f5
chore: deduplicate OAuth login code ( #3575 )
2022-08-22 18:13:46 -05:00
Ammar Bandukwala
a07ca946c3
Increase default auto-stop to 12h ( #3631 )
...
Resolves #3462 .
And, clarify language to resolve #3509 .
2022-08-22 17:24:15 -05:00
Spike Curtis
b101a6f3f4
POST license API endpoint ( #3570 )
...
* POST license API
Signed-off-by: Spike Curtis <spike@coder.com >
* Support interface{} types in generated Typescript
Signed-off-by: Spike Curtis <spike@coder.com >
* Disable linting on empty interface any
Signed-off-by: Spike Curtis <spike@coder.com >
* Code review updates
Signed-off-by: Spike Curtis <spike@coder.com >
* Enforce unique licenses
Signed-off-by: Spike Curtis <spike@coder.com >
* Renames from code review
Signed-off-by: Spike Curtis <spike@coder.com >
* Code review renames and comments
Signed-off-by: Spike Curtis <spike@coder.com >
Signed-off-by: Spike Curtis <spike@coder.com >
2022-08-22 15:02:50 -07:00
Kyle Carberry
58d29264aa
feat: Add template icon to the workspaces page ( #3612 )
...
This removes the last built by column from the page. It seemed
cluttered to have both on the page, and is simple enough to
click on the workspace to see additional info.
2022-08-22 09:42:11 -05:00
Kyle Carberry
b0fe9bcdd1
chore: Upgrade to Go 1.19 ( #3617 )
...
This is required as part of #3505 .
2022-08-21 22:32:53 +00:00
Kyle Carberry
985eea6099
fix: Update icon when metadata is changed ( #3587 )
...
This was causing names to become empty! Fixes #3586 .
2022-08-19 10:11:54 -05:00
Bruno Quaresma
80f042f01b
feat: Add icon to templates ( #3561 )
2022-08-19 13:17:35 +00:00
Jon Ayers
f6b0835982
fix: avoid processing updates to usernames ( #3571 )
...
- With the support of OIDC we began processing updates to a user's
email and username to stay in sync with the upstream provider. This
can cause issues in templates that use the user's username as a stable
identifier, potentially causing the deletion of user's home volumes.
- Fix some faulty error wrapping.
2022-08-18 17:56:17 -05:00
Kyle Carberry
c43297937b
feat: Add Kubernetes and resource metadata telemetry ( #3548 )
...
Fixes #3524 .
2022-08-18 15:57:46 +00:00
Jon Ayers
380022fe63
fix: update oauth token on each login ( #3542 )
2022-08-17 23:06:03 -05:00
Jon Ayers
c3eea98db0
fix: use unique ID for linked accounts ( #3441 )
...
- move OAuth-related fields off of api_keys into a new user_links table
- restrict users to single form of login
- process updates to user email/usernames for OIDC
- added a login_type column to users
2022-08-17 18:00:53 -05:00
Bruno Quaresma
546157b63e
feat: Make template name editable ( #3538 )
2022-08-17 19:04:00 +00:00
Spike Curtis
acd0cd66f6
coder features list CLI command ( #3533 )
...
* AGPL Entitlements API
Signed-off-by: Spike Curtis <spike@coder.com >
* Generate typesGenerated.ts
Signed-off-by: Spike Curtis <spike@coder.com >
* AllFeatures -> FeatureNames
Signed-off-by: Spike Curtis <spike@coder.com >
* Features CLI command
Signed-off-by: Spike Curtis <spike@coder.com >
* Validate columns
Signed-off-by: Spike Curtis <spike@coder.com >
* Tests for features list CLI command
Signed-off-by: Spike Curtis <spike@coder.com >
* Drop empty EntitlementsRequest
Signed-off-by: Spike Curtis <spike@coder.com >
* Fix dump.sql generation
Signed-off-by: Spike Curtis <spike@coder.com >
Signed-off-by: Spike Curtis <spike@coder.com >
2022-08-17 11:26:16 -07:00
Kyle Carberry
c3f946737c
fix: Strip session_token cookie from app proxy requests ( #3528 )
...
Fixes coder/security#1 .
2022-08-17 17:09:45 +00:00
Spike Curtis
b1b2d1b2b2
AGPL Entitlements API ( #3523 )
...
* AGPL Entitlements API
Signed-off-by: Spike Curtis <spike@coder.com >
* Generate typesGenerated.ts
Signed-off-by: Spike Curtis <spike@coder.com >
* AllFeatures -> FeatureNames
Signed-off-by: Spike Curtis <spike@coder.com >
Signed-off-by: Spike Curtis <spike@coder.com >
2022-08-17 09:02:36 -07:00
Steven Masley
4be61d9250
fix: Role assign ui fixes ( #3521 )
...
Co-authored-by: Kira Pilot <kira@coder.com >
2022-08-16 10:39:42 -05:00
Steven Masley
01dd35f1ba
chore: Rename 'admin' to 'owner' ( #3498 )
...
Co-authored-by: Colin Adler <colin1adler@gmail.com >
2022-08-15 14:40:19 -05:00
Jon Ayers
301727d1fc
chore: improve dump error output ( #3499 )
...
* chore: improve dump error output
- Properly report the error that occurs during the DB connection retry
loop.
- Fail fatally if migration is unsuccessful.
2022-08-12 22:15:13 -05:00
Steven Masley
40e68cb80b
feat: Add template-admin + user-admin role for managing templates + users ( #3490 )
...
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com >
2022-08-12 17:27:48 -05:00
Kyle Carberry
3b951f77fb
fix: Unskip SuspendAnotherUser test ( #3430 )
...
It wasn't clear why this was skipped, it seems accidental.
2022-08-12 19:12:44 +00:00
Kyle Carberry
ca342067b3
fix: Remove typo in policy.rego
2022-08-11 23:33:50 -05:00
Ammar Bandukwala
d7b96f7d58
Correct spelling of macOS ( #3478 )
...
* Correct spelling of macOS
* fixup! Correct spelling of macOS
* fixup! Correct spelling of macOS
2022-08-11 21:22:06 -04:00
Steven Masley
3ae42f4de9
chore: Update rego to be partial execution friendly ( #3449 )
...
- Improves performance of batch authorization calls
- Enables possibility to convert rego auth calls into SQL WHERE clauses
2022-08-11 22:07:48 +00:00
Kira Pilot
6122df6f1f
feature: gate audit log by permissions ( #3464 )
...
* pairing
* restricting audit route
resolvees #3460
* updated tests
* fixing lint
* useSelector instead of useActor
2022-08-11 09:34:45 -04:00
Steven Masley
db665e7261
chore: Drop resource_id support in rbac system ( #3426 )
2022-08-09 18:16:53 +00:00
Mathias Fredriksson
ccf6f4e7ed
chore: Use contexts with timeout in coderd tests ( #3381 )
2022-08-09 20:17:00 +03:00
Mathias Fredriksson
c0cc8b9935
fix: Improve friendly validation error messages ( #3390 )
...
* fix: Add validations to `(*codersdk.Error).Friendly`
* fix: Add named validators for template and workspace name
2022-08-09 14:25:23 +03:00
Kyle Carberry
7bdb8ff9cf
feat: Add workspace metrics export to Prometheus ( #3421 )
...
This adds workspace totals indexed by status. It could be any
codersdk.ProvisionerJobStatus.
2022-08-09 01:08:42 +00:00
Kyle Carberry
42bac09c1a
fix: Sort workspace agents by name ( #3407 )
...
Fixes #2778 .
2022-08-08 12:25:29 -05:00
Kyle Carberry
9c12b4ed8e
chore: Add nix shell for simple development setup ( #3399 )
...
* chore: Add nix shell for simple development setup
This enables contributors using Nix to set up their environment with ease.
* improve nix style, flake output schema
* fix error message
* Update scripts/build_go_slim.sh
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com >
* Update scripts/build_go_slim.sh
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com >
* Add UTC default for timezone and remove unnecessary goreleaser dependency
* Skip TZ test if localtime does not exist
Co-authored-by: Charlie Moog <moogcharlie@gmail.com >
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com >
2022-08-08 15:49:12 +00:00
Kyle Carberry
3279504cbe
feat: Add active users prometheus metric ( #3406 )
...
This allows deployments using our Prometheus export t determine
the number of active users in the past hour.
The interval is an hour to align with API key last used refresh times.
SSH connections poll to check shutdown time, so this will be accurate
even on long-running connections without dashboard requests.
2022-08-08 10:09:46 -05:00
Ben Potter
f14efd1a2b
chore: alphabetize template list ( #3363 )
2022-08-05 13:03:22 -05:00
Cian Johnston
01fe5e668e
chore: add testutil.Eventually and friends ( #3389 )
...
This PR adds a `testutil` function aimed to replace `require.Eventually`.
Before:
```go
require.Eventually(t, func() bool { ... }, testutil.WaitShort, testutil.IntervalFast)
```
After:
```go
require.True(t, testutil.EventuallyShort(t, func(ctx context.Context) bool { ... }))
// or the full incantation if you need more control
ctx, cancel := context.WithTimeout(ctx.Background(), testutil.WaitLong)
require.True(t, testutil.Eventually(t, ctx, func(ctx context.Context) bool { ... }, testutil.IntervalSlow))
```
Co-authored-by: Mathias Fredriksson <mafredri@gmail.com >
2022-08-05 16:34:44 +01:00
Abhineet Jain
8bcf23e60a
fix: handle create workspace errors ( #3346 )
2022-08-02 13:19:00 -04:00
David Wahler
8a2811210a
feat: Add backend API support for resource metadata ( #3242 )
...
* Initial support for metadata in provisioner API and Terraform provisioner
* add support for nullable metadata fields
* handle metadata fields in provisionerd and API
2022-08-01 16:53:05 -05:00
Ammar Bandukwala
19fcf60864
ci: add typo detection ( #3327 )
...
And fix them.
2022-08-01 09:29:52 -04:00
Mathias Fredriksson
4730c589fe
chore: Use standardized test timeouts and delays ( #3291 )
2022-08-01 15:45:05 +03:00
Kyle Carberry
3d0febdd90
feat: Add OIDC authentication ( #3314 )
...
* feat: Add OIDC authentication
* Extract username into a separate package and add OIDC tests
* Add test case for invalid tokens
* Add test case for username as email
* Add OIDC to the frontend
* Improve comments from self-review
* Add authentication docs
* Add telemetry
* Update docs/install/auth.md
Co-authored-by: Ammar Bandukwala <ammar@ammar.io >
* Update docs/install/auth.md
Co-authored-by: Ammar Bandukwala <ammar@ammar.io >
* Remove username package
Co-authored-by: Ammar Bandukwala <ammar@ammar.io >
2022-07-31 23:05:35 -05:00
Abhineet Jain
e94fe20b6b
fix: handle getUser error ( #3285 )
2022-07-29 13:10:22 -04:00
Cian Johnston
4658b3f0d2
fix: coderd: putExtendWorkspace: move error from validation to message ( #3289 )
...
* refactor: coderd: extract error messages to variables
* fix: putExtendWorkspace: return validation error in message field
2022-07-29 15:01:17 +01:00