audit

package
v1.0.0-beta.5 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package audit is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var AuditService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "audit.v1.AuditService",
	HandlerType: (*AuditServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "AuditLog",
			Handler:       _AuditService_AuditLog_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "audit/v1/audit.proto",
}

AuditService_ServiceDesc is the grpc.ServiceDesc for AuditService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_audit_v1_audit_proto protoreflect.FileDescriptor

Functions

func RegisterAuditServiceHandler

func RegisterAuditServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterAuditServiceHandler registers the http handlers for service AuditService to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterAuditServiceHandlerClient

func RegisterAuditServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuditServiceClient) error

RegisterAuditServiceHandlerClient registers the http handlers for service AuditService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuditServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuditServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "AuditServiceClient" to call the correct interceptors.

func RegisterAuditServiceHandlerFromEndpoint

func RegisterAuditServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterAuditServiceHandlerFromEndpoint is same as RegisterAuditServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterAuditServiceHandlerServer

func RegisterAuditServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuditServiceServer) error

RegisterAuditServiceHandlerServer registers the http handlers for service AuditService to "mux". UnaryRPC :call AuditServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuditServiceHandlerFromEndpoint instead.

func RegisterAuditServiceServer

func RegisterAuditServiceServer(s grpc.ServiceRegistrar, srv AuditServiceServer)

Types

type AuditEntry

type AuditEntry struct {
	Seq           uint64                 `protobuf:"varint,1,opt,name=seq,proto3" json:"seq,omitempty"`
	Timestamp     *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	RequestId     string                 `protobuf:"bytes,3,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
	Subject       string                 `protobuf:"bytes,4,opt,name=subject,proto3" json:"subject,omitempty"`
	Username      string                 `protobuf:"bytes,5,opt,name=username,proto3" json:"username,omitempty"`
	Groups        []string               `protobuf:"bytes,6,rep,name=groups,proto3" json:"groups,omitempty"`
	Issuer        string                 `protobuf:"bytes,7,opt,name=issuer,proto3" json:"issuer,omitempty"`
	Cluster       string                 `protobuf:"bytes,8,opt,name=cluster,proto3" json:"cluster,omitempty"`
	Backend       string                 `protobuf:"bytes,9,opt,name=backend,proto3" json:"backend,omitempty"`
	Route         string                 `protobuf:"bytes,10,opt,name=route,proto3" json:"route,omitempty"`
	Method        string                 `protobuf:"bytes,11,opt,name=method,proto3" json:"method,omitempty"`
	Path          string                 `protobuf:"bytes,12,opt,name=path,proto3" json:"path,omitempty"`
	SourceIp      string                 `protobuf:"bytes,13,opt,name=source_ip,json=sourceIp,proto3" json:"source_ip,omitempty"`
	UserAgent     string                 `protobuf:"bytes,14,opt,name=user_agent,json=userAgent,proto3" json:"user_agent,omitempty"`
	K8SVerb       string                 `protobuf:"bytes,15,opt,name=k8s_verb,json=k8sVerb,proto3" json:"k8s_verb,omitempty"`
	ApiGroup      string                 `protobuf:"bytes,16,opt,name=api_group,json=apiGroup,proto3" json:"api_group,omitempty"`
	Resource      string                 `protobuf:"bytes,17,opt,name=resource,proto3" json:"resource,omitempty"`
	Namespace     string                 `protobuf:"bytes,18,opt,name=namespace,proto3" json:"namespace,omitempty"`
	Name          string                 `protobuf:"bytes,19,opt,name=name,proto3" json:"name,omitempty"`
	SubResource   string                 `protobuf:"bytes,20,opt,name=sub_resource,json=subResource,proto3" json:"sub_resource,omitempty"`
	Allowed       bool                   `protobuf:"varint,21,opt,name=allowed,proto3" json:"allowed,omitempty"`
	StatusCode    int32                  `protobuf:"varint,22,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	DurationMs    int64                  `protobuf:"varint,23,opt,name=duration_ms,json=durationMs,proto3" json:"duration_ms,omitempty"`
	Error         string                 `protobuf:"bytes,24,opt,name=error,proto3" json:"error,omitempty"`
	PolicyIds     []string               `protobuf:"bytes,25,rep,name=policy_ids,json=policyIds,proto3" json:"policy_ids,omitempty"`
	ConfigVersion uint64                 `protobuf:"varint,26,opt,name=config_version,json=configVersion,proto3" json:"config_version,omitempty"`
	// contains filtered or unexported fields
}

func (*AuditEntry) Descriptor deprecated

func (*AuditEntry) Descriptor() ([]byte, []int)

Deprecated: Use AuditEntry.ProtoReflect.Descriptor instead.

func (*AuditEntry) GetAllowed

func (x *AuditEntry) GetAllowed() bool

func (*AuditEntry) GetApiGroup

func (x *AuditEntry) GetApiGroup() string

func (*AuditEntry) GetBackend

func (x *AuditEntry) GetBackend() string

func (*AuditEntry) GetCluster

func (x *AuditEntry) GetCluster() string

func (*AuditEntry) GetConfigVersion

func (x *AuditEntry) GetConfigVersion() uint64

func (*AuditEntry) GetDurationMs

func (x *AuditEntry) GetDurationMs() int64

func (*AuditEntry) GetError

func (x *AuditEntry) GetError() string

func (*AuditEntry) GetGroups

func (x *AuditEntry) GetGroups() []string

func (*AuditEntry) GetIssuer

func (x *AuditEntry) GetIssuer() string

func (*AuditEntry) GetK8SVerb

func (x *AuditEntry) GetK8SVerb() string

func (*AuditEntry) GetMethod

func (x *AuditEntry) GetMethod() string

func (*AuditEntry) GetName

func (x *AuditEntry) GetName() string

func (*AuditEntry) GetNamespace

func (x *AuditEntry) GetNamespace() string

func (*AuditEntry) GetPath

func (x *AuditEntry) GetPath() string

func (*AuditEntry) GetPolicyIds

func (x *AuditEntry) GetPolicyIds() []string

func (*AuditEntry) GetRequestId

func (x *AuditEntry) GetRequestId() string

func (*AuditEntry) GetResource

func (x *AuditEntry) GetResource() string

func (*AuditEntry) GetRoute

func (x *AuditEntry) GetRoute() string

func (*AuditEntry) GetSeq

func (x *AuditEntry) GetSeq() uint64

func (*AuditEntry) GetSourceIp

func (x *AuditEntry) GetSourceIp() string

func (*AuditEntry) GetStatusCode

func (x *AuditEntry) GetStatusCode() int32

func (*AuditEntry) GetSubResource

func (x *AuditEntry) GetSubResource() string

func (*AuditEntry) GetSubject

func (x *AuditEntry) GetSubject() string

func (*AuditEntry) GetTimestamp

func (x *AuditEntry) GetTimestamp() *timestamppb.Timestamp

func (*AuditEntry) GetUserAgent

func (x *AuditEntry) GetUserAgent() string

func (*AuditEntry) GetUsername

func (x *AuditEntry) GetUsername() string

func (*AuditEntry) ProtoMessage

func (*AuditEntry) ProtoMessage()

func (*AuditEntry) ProtoReflect

func (x *AuditEntry) ProtoReflect() protoreflect.Message

func (*AuditEntry) Reset

func (x *AuditEntry) Reset()

func (*AuditEntry) String

func (x *AuditEntry) String() string

type AuditLogRequest

type AuditLogRequest struct {
	SessionId    string `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	Watch        bool   `protobuf:"varint,2,opt,name=watch,proto3" json:"watch,omitempty"`
	SinceSeconds int64  `protobuf:"varint,3,opt,name=since_seconds,json=sinceSeconds,proto3" json:"since_seconds,omitempty"`
	Tail         int64  `protobuf:"varint,4,opt,name=tail,proto3" json:"tail,omitempty"`
	Limit        int64  `protobuf:"varint,5,opt,name=limit,proto3" json:"limit,omitempty"`
	// contains filtered or unexported fields
}

func (*AuditLogRequest) Descriptor deprecated

func (*AuditLogRequest) Descriptor() ([]byte, []int)

Deprecated: Use AuditLogRequest.ProtoReflect.Descriptor instead.

func (*AuditLogRequest) GetLimit

func (x *AuditLogRequest) GetLimit() int64

func (*AuditLogRequest) GetSessionId

func (x *AuditLogRequest) GetSessionId() string

func (*AuditLogRequest) GetSinceSeconds

func (x *AuditLogRequest) GetSinceSeconds() int64

func (*AuditLogRequest) GetTail

func (x *AuditLogRequest) GetTail() int64

func (*AuditLogRequest) GetWatch

func (x *AuditLogRequest) GetWatch() bool

func (*AuditLogRequest) ProtoMessage

func (*AuditLogRequest) ProtoMessage()

func (*AuditLogRequest) ProtoReflect

func (x *AuditLogRequest) ProtoReflect() protoreflect.Message

func (*AuditLogRequest) Reset

func (x *AuditLogRequest) Reset()

func (*AuditLogRequest) String

func (x *AuditLogRequest) String() string

type AuditLogResponse

type AuditLogResponse struct {
	SessionId string      `protobuf:"bytes,1,opt,name=session_id,json=sessionId,proto3" json:"session_id,omitempty"`
	Entry     *AuditEntry `protobuf:"bytes,2,opt,name=entry,proto3" json:"entry,omitempty"`
	// contains filtered or unexported fields
}

func (*AuditLogResponse) Descriptor deprecated

func (*AuditLogResponse) Descriptor() ([]byte, []int)

Deprecated: Use AuditLogResponse.ProtoReflect.Descriptor instead.

func (*AuditLogResponse) GetEntry

func (x *AuditLogResponse) GetEntry() *AuditEntry

func (*AuditLogResponse) GetSessionId

func (x *AuditLogResponse) GetSessionId() string

func (*AuditLogResponse) ProtoMessage

func (*AuditLogResponse) ProtoMessage()

func (*AuditLogResponse) ProtoReflect

func (x *AuditLogResponse) ProtoReflect() protoreflect.Message

func (*AuditLogResponse) Reset

func (x *AuditLogResponse) Reset()

func (*AuditLogResponse) String

func (x *AuditLogResponse) String() string

type AuditServiceClient

type AuditServiceClient interface {
	AuditLog(ctx context.Context, in *AuditLogRequest, opts ...grpc.CallOption) (AuditService_AuditLogClient, error)
}

AuditServiceClient is the client API for AuditService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type AuditServiceServer

type AuditServiceServer interface {
	AuditLog(*AuditLogRequest, AuditService_AuditLogServer) error
	// contains filtered or unexported methods
}

AuditServiceServer is the server API for AuditService service. All implementations must embed UnimplementedAuditServiceServer for forward compatibility

type AuditService_AuditLogClient

type AuditService_AuditLogClient interface {
	Recv() (*AuditLogResponse, error)
	grpc.ClientStream
}

type AuditService_AuditLogServer

type AuditService_AuditLogServer interface {
	Send(*AuditLogResponse) error
	grpc.ServerStream
}

type UnimplementedAuditServiceServer

type UnimplementedAuditServiceServer struct {
}

UnimplementedAuditServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAuditServiceServer) AuditLog

type UnsafeAuditServiceServer

type UnsafeAuditServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeAuditServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to AuditServiceServer will result in compilation errors.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL