mirror of
https://github.com/coder/coder.git
synced 2025-07-08 11:39:50 +00:00
fix: add workspace_proxy type to auditlog friendly strings (#9194)
* fix: add workspace_proxy type to auditlog friendly strings * add unit test and organization type
This commit is contained in:
8
coderd/apidoc/docs.go
generated
8
coderd/apidoc/docs.go
generated
@ -9281,7 +9281,9 @@ const docTemplate = `{
|
||||
"api_key",
|
||||
"group",
|
||||
"license",
|
||||
"convert_login"
|
||||
"convert_login",
|
||||
"workspace_proxy",
|
||||
"organization"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"ResourceTypeTemplate",
|
||||
@ -9293,7 +9295,9 @@ const docTemplate = `{
|
||||
"ResourceTypeAPIKey",
|
||||
"ResourceTypeGroup",
|
||||
"ResourceTypeLicense",
|
||||
"ResourceTypeConvertLogin"
|
||||
"ResourceTypeConvertLogin",
|
||||
"ResourceTypeWorkspaceProxy",
|
||||
"ResourceTypeOrganization"
|
||||
]
|
||||
},
|
||||
"codersdk.Response": {
|
||||
|
8
coderd/apidoc/swagger.json
generated
8
coderd/apidoc/swagger.json
generated
@ -8354,7 +8354,9 @@
|
||||
"api_key",
|
||||
"group",
|
||||
"license",
|
||||
"convert_login"
|
||||
"convert_login",
|
||||
"workspace_proxy",
|
||||
"organization"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"ResourceTypeTemplate",
|
||||
@ -8366,7 +8368,9 @@
|
||||
"ResourceTypeAPIKey",
|
||||
"ResourceTypeGroup",
|
||||
"ResourceTypeLicense",
|
||||
"ResourceTypeConvertLogin"
|
||||
"ResourceTypeConvertLogin",
|
||||
"ResourceTypeWorkspaceProxy",
|
||||
"ResourceTypeOrganization"
|
||||
]
|
||||
},
|
||||
"codersdk.Response": {
|
||||
|
@ -5,10 +5,24 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/coder/coder/v2/coderd/database"
|
||||
"github.com/coder/coder/v2/codersdk"
|
||||
)
|
||||
|
||||
// TestAuditDBEnumsCovered ensures that all enums in the database are covered by the codersdk enums
|
||||
// for audit log strings.
|
||||
func TestAuditDBEnumsCovered(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
dbTypes := database.AllResourceTypeValues()
|
||||
for _, ty := range dbTypes {
|
||||
str := codersdk.ResourceType(ty).FriendlyString()
|
||||
require.NotEqualf(t, "unknown", str, "ResourceType %q not covered by codersdk.ResourceType", ty)
|
||||
}
|
||||
}
|
||||
|
||||
// TestViewSubsetTemplate ensures TemplateTable is a subset of Template
|
||||
func TestViewSubsetTemplate(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
Reference in New Issue
Block a user