mirror of
https://github.com/coder/coder.git
synced 2025-07-08 11:39:50 +00:00
chore: removing unaudited resources (#5885)
* chore: removing unaudited resources * cleaned up tests * CI errors
This commit is contained in:
6
coderd/apidoc/docs.go
generated
6
coderd/apidoc/docs.go
generated
@ -5648,15 +5648,13 @@ const docTemplate = `{
|
||||
},
|
||||
"resource_type": {
|
||||
"enum": [
|
||||
"organization",
|
||||
"template",
|
||||
"template_version",
|
||||
"user",
|
||||
"workspace",
|
||||
"workspace_build",
|
||||
"git_ssh_key",
|
||||
"api_key",
|
||||
"group"
|
||||
"auditable_group"
|
||||
],
|
||||
"allOf": [
|
||||
{
|
||||
@ -7114,7 +7112,6 @@ const docTemplate = `{
|
||||
"codersdk.ResourceType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"organization",
|
||||
"template",
|
||||
"template_version",
|
||||
"user",
|
||||
@ -7125,7 +7122,6 @@ const docTemplate = `{
|
||||
"group"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"ResourceTypeOrganization",
|
||||
"ResourceTypeTemplate",
|
||||
"ResourceTypeTemplateVersion",
|
||||
"ResourceTypeUser",
|
||||
|
6
coderd/apidoc/swagger.json
generated
6
coderd/apidoc/swagger.json
generated
@ -4996,15 +4996,13 @@
|
||||
},
|
||||
"resource_type": {
|
||||
"enum": [
|
||||
"organization",
|
||||
"template",
|
||||
"template_version",
|
||||
"user",
|
||||
"workspace",
|
||||
"workspace_build",
|
||||
"git_ssh_key",
|
||||
"api_key",
|
||||
"group"
|
||||
"auditable_group"
|
||||
],
|
||||
"allOf": [
|
||||
{
|
||||
@ -6369,7 +6367,6 @@
|
||||
"codersdk.ResourceType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"organization",
|
||||
"template",
|
||||
"template_version",
|
||||
"user",
|
||||
@ -6380,7 +6377,6 @@
|
||||
"group"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"ResourceTypeOrganization",
|
||||
"ResourceTypeTemplate",
|
||||
"ResourceTypeTemplateVersion",
|
||||
"ResourceTypeUser",
|
||||
|
@ -452,8 +452,6 @@ func auditSearchQuery(query string) (database.GetAuditLogsOffsetParams, []coders
|
||||
|
||||
func resourceTypeFromString(resourceTypeString string) string {
|
||||
switch codersdk.ResourceType(resourceTypeString) {
|
||||
case codersdk.ResourceTypeOrganization:
|
||||
return resourceTypeString
|
||||
case codersdk.ResourceTypeTemplate:
|
||||
return resourceTypeString
|
||||
case codersdk.ResourceTypeTemplateVersion:
|
||||
|
@ -9,8 +9,6 @@ import (
|
||||
// AuditableResources, then add it to this interface.
|
||||
type Auditable interface {
|
||||
database.APIKey |
|
||||
database.Organization |
|
||||
database.OrganizationMember |
|
||||
database.Template |
|
||||
database.TemplateVersion |
|
||||
database.User |
|
||||
|
@ -49,8 +49,6 @@ type BuildAuditParams[T Auditable] struct {
|
||||
|
||||
func ResourceTarget[T Auditable](tgt T) string {
|
||||
switch typed := any(tgt).(type) {
|
||||
case database.Organization:
|
||||
return typed.Name
|
||||
case database.Template:
|
||||
return typed.Name
|
||||
case database.TemplateVersion:
|
||||
@ -73,8 +71,6 @@ func ResourceTarget[T Auditable](tgt T) string {
|
||||
|
||||
func ResourceID[T Auditable](tgt T) uuid.UUID {
|
||||
switch typed := any(tgt).(type) {
|
||||
case database.Organization:
|
||||
return typed.ID
|
||||
case database.Template:
|
||||
return typed.ID
|
||||
case database.TemplateVersion:
|
||||
@ -96,8 +92,6 @@ func ResourceID[T Auditable](tgt T) uuid.UUID {
|
||||
|
||||
func ResourceType[T Auditable](tgt T) database.ResourceType {
|
||||
switch any(tgt).(type) {
|
||||
case database.Organization:
|
||||
return database.ResourceTypeOrganization
|
||||
case database.Template:
|
||||
return database.ResourceTypeTemplate
|
||||
case database.TemplateVersion:
|
||||
|
Reference in New Issue
Block a user