Movatterモバイル変換


[0]ホーム

URL:


Alert GO-2024-3228: Coder vulnerable to post-auth URL redirection to untrusted site ('Open Redirect') in github.com/coder/coder
Notice  The highest tagged major version isv2.

audit

package
v0.27.3Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2023 License:AGPL-3.0Imports:14Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

funcBuildAuditadded inv0.13.0

func BuildAudit[TAuditable](ctxcontext.Context, p *BuildAuditParams[T])

BuildAudit creates an audit log for a workspace build.The audit log is committed upon invocation.

funcEmpty

func Empty[TAuditable]() T

Empty returns a default value of type T.

funcResourceIDadded inv0.8.15

func ResourceID[TAuditable](tgt T)uuid.UUID

funcResourceTargetadded inv0.8.15

func ResourceTarget[TAuditable](tgt T)string

funcResourceTypeadded inv0.8.15

func ResourceType[TAuditable](tgt T)database.ResourceType

Types

typeAdditionalFieldsadded inv0.16.0

type AdditionalFields struct {WorkspaceNamestring               `json:"workspace_name"`BuildNumberstring               `json:"build_number"`BuildReasondatabase.BuildReason `json:"build_reason"`WorkspaceOwnerstring               `json:"workspace_owner"`}

typeAuditable

Auditable is mostly a marker interface. It contains a definitive list of allauditable types. If you want to audit a new type, first define it inAuditableResources, then add it to this interface.

typeAuditoradded inv0.8.11

type Auditor interface {Export(ctxcontext.Context, alogdatabase.AuditLog)error// contains filtered or unexported methods}

funcNewNopadded inv0.8.11

func NewNop()Auditor

typeBuildAuditParamsadded inv0.13.0

type BuildAuditParams[TAuditable] struct {AuditAuditorLogslog.LoggerUserIDuuid.UUIDJobIDuuid.UUIDStatusintActiondatabase.AuditActionAdditionalFieldsjson.RawMessageNew TOld T}

typeDifferadded inv0.8.11

type Differ struct {DiffFn func(old, newany)Map}

Differ is used so the enterprise version can implement the diff function inthe Auditor feature interface. Only types in the same package as theinterface can implement unexported methods.

typeMap

type Map map[string]OldNew

Map is a map of changed fields in an audited resource. It maps field names tothe old and new value for that field.

funcDiff

func Diff[TAuditable](aAuditor, left, right T)Map

Diff compares two auditable resources and produces a Map of the changedvalues.

typeMockAuditoradded inv0.8.15

type MockAuditor struct {// contains filtered or unexported fields}

funcNewMockadded inv0.8.15

func NewMock() *MockAuditor

func (*MockAuditor)AuditLogsadded inv0.8.15

func (a *MockAuditor) AuditLogs() []database.AuditLog

func (*MockAuditor)Exportadded inv0.8.15

func (*MockAuditor)ResetLogsadded inv0.25.0

func (a *MockAuditor) ResetLogs()

ResetLogs removes all audit logs from the mock auditor.This is helpful for testing to get a clean slate.

typeOldNewadded inv0.8.11

type OldNew struct {OldanyNewanySecretbool}

OldNew is a pair of values representing the old value and the new value.

typeRequestadded inv0.8.11

type Request[TAuditable] struct {Old TNew T// This optional field can be passed in when the userID cannot be determined from the API Key// such as in the case of login, when the audit log is created prior the API Key's existence.UserIDuuid.UUID// This optional field can be passed in if the AuditAction must be overridden// such as in the case of new user authentication when the Audit Action is 'register', not 'login'.Actiondatabase.AuditAction// contains filtered or unexported fields}

funcInitRequestadded inv0.8.11

func InitRequest[TAuditable](whttp.ResponseWriter, p *RequestParams) (*Request[T], func())

InitRequest initializes an audit log for a request. It returns a functionthat should be deferred, causing the audit log to be committed when thehandler returns.

typeRequestParamsadded inv0.8.11

type RequestParams struct {AuditAuditorLogslog.LoggerRequest          *http.RequestActiondatabase.AuditActionAdditionalFieldsjson.RawMessage}

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp