Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
fd05de9
chore: Refactor Enterprise code to layer on top of AGPL
kylecarbs Sep 13, 2022
04c5d1d
Merge branch 'main' into entfactor
kylecarbs Sep 13, 2022
aad7be4
Fix Garrett's comments
kylecarbs Sep 13, 2022
d0526ed
Merge branch 'main' into entfactor
kylecarbs Sep 15, 2022
27f53aa
Add pointer.Handle to atomically obtain references
kylecarbs Sep 15, 2022
ed5b96d
Remove entitlements API from AGPL coderd
kylecarbs Sep 15, 2022
be96fff
Remove AGPL Coder entitlements endpoint test
kylecarbs Sep 15, 2022
b4cbd6c
Fix warnings output
kylecarbs Sep 15, 2022
ad3cb79
Merge branch 'main' into entfactor
kylecarbs Sep 15, 2022
1964a64
Add command-line flag to toggle audit logging
kylecarbs Sep 15, 2022
0e88f51
Fix hasLicense being set
kylecarbs Sep 15, 2022
586b3e8
Remove features interface
kylecarbs Sep 15, 2022
1bb6d0f
Fix audit logging default
kylecarbs Sep 15, 2022
8c603f6
Add bash as a dependency
kylecarbs Sep 16, 2022
2dcf1f8
Add comment
kylecarbs Sep 16, 2022
2cfcfac
Merge branch 'main' into entfactor
kylecarbs Sep 18, 2022
5215fe9
Merge branch 'main' into entfactor
kylecarbs Sep 19, 2022
1955ae3
Add tests for resync and pubsub, and add back previous exp backoff retry
kylecarbs Sep 19, 2022
e01a6ce
Separate authz code again
kylecarbs Sep 19, 2022
b0a3c95
Add pointer loading example from comment
kylecarbs Sep 19, 2022
2b87ae1
Fix duplicate test, remove pointer.Handle
kylecarbs Sep 19, 2022
7fd0903
Fix expired license
kylecarbs Sep 19, 2022
c67605b
Add entitlements struct
kylecarbs Sep 19, 2022
b8776cb
Merge branch 'main' into entfactor
kylecarbs Sep 20, 2022
7f9ed39
Fix context passing
kylecarbs Sep 20, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add comment
  • Loading branch information
kylecarbs committed Sep 16, 2022
commit 2dcf1f884d1335cdc81d6cde4759efd53aa5fd81
1 change: 1 addition & 0 deletions enterprise/coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ func (api *API) updateEntitlements(ctx context.Context) error {
}
auditLogs := codersdk.EntitlementNotEntitled

// Here we loop through licenses to detect enabled features.
for _, l := range licenses {
claims, err := validateDBLicense(l, api.Keys)
if err != nil {
Expand Down
14 changes: 7 additions & 7 deletions enterprise/coderd/licenses_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
func TestPostLicense(t *testing.T) {
t.Parallel()

t.Run("POST", func(t *testing.T) {
t.Run("Success", func(t *testing.T) {
t.Parallel()
client := coderdenttest.New(t, nil)
_ = coderdtest.CreateFirstUser(t, client)
Expand All @@ -37,7 +37,7 @@ func TestPostLicense(t *testing.T) {
assert.Equal(t, json.Number("1"), features[codersdk.FeatureAuditLog])
})

t.Run("POST_unauthorized", func(t *testing.T) {
t.Run("Unauthorized", func(t *testing.T) {
t.Parallel()
client := coderdenttest.New(t, nil)
_, err := client.AddLicense(context.Background(), codersdk.AddLicenseRequest{
Expand All @@ -51,7 +51,7 @@ func TestPostLicense(t *testing.T) {
}
})

t.Run("POST_corrupted", func(t *testing.T) {
t.Run("Corrupted", func(t *testing.T) {
t.Parallel()
client := coderdenttest.New(t, nil)
_ = coderdtest.CreateFirstUser(t, client)
Expand All @@ -70,7 +70,7 @@ func TestPostLicense(t *testing.T) {

func TestGetLicense(t *testing.T) {
t.Parallel()
t.Run("GET", func(t *testing.T) {
t.Run("Success", func(t *testing.T) {
t.Parallel()
client := coderdenttest.New(t, nil)
_ = coderdtest.CreateFirstUser(t, client)
Expand Down Expand Up @@ -108,7 +108,7 @@ func TestGetLicense(t *testing.T) {

func TestDeleteLicense(t *testing.T) {
t.Parallel()
t.Run("DELETE_empty", func(t *testing.T) {
t.Run("Empty", func(t *testing.T) {
t.Parallel()
client := coderdenttest.New(t, nil)
_ = coderdtest.CreateFirstUser(t, client)
Expand All @@ -124,7 +124,7 @@ func TestDeleteLicense(t *testing.T) {
}
})

t.Run("DELETE_bad_id", func(t *testing.T) {
t.Run("BadID", func(t *testing.T) {
t.Parallel()
client := coderdenttest.New(t, nil)
_ = coderdtest.CreateFirstUser(t, client)
Expand All @@ -137,7 +137,7 @@ func TestDeleteLicense(t *testing.T) {
require.NoError(t, resp.Body.Close())
})

t.Run("DELETE", func(t *testing.T) {
t.Run("Success", func(t *testing.T) {
t.Parallel()
client := coderdenttest.New(t, nil)
_ = coderdtest.CreateFirstUser(t, client)
Expand Down