pathz

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 9 Imported by: 12

README

gNSI OpenConfig Path Based Authorization Policy

OpenConfig Data models for gNSI pathz

Yang data models for certz are defined in the [OpenConfig public repository(https://github.com/openconfig/public/tree/master/release/models/gnsi)]. Documentation for OpenConfig including searchable list of paths and tree representations are at OpenConfig.net

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PolicyInstance_name = map[int32]string{
		0: "POLICY_INSTANCE_UNSPECIFIED",
		1: "POLICY_INSTANCE_ACTIVE",
		2: "POLICY_INSTANCE_SANDBOX",
	}
	PolicyInstance_value = map[string]int32{
		"POLICY_INSTANCE_UNSPECIFIED": 0,
		"POLICY_INSTANCE_ACTIVE":      1,
		"POLICY_INSTANCE_SANDBOX":     2,
	}
)

Enum value maps for PolicyInstance.

View Source
var (
	Action_name = map[int32]string{
		0: "ACTION_UNSPECIFIED",
		1: "ACTION_DENY",
		2: "ACTION_PERMIT",
	}
	Action_value = map[string]int32{
		"ACTION_UNSPECIFIED": 0,
		"ACTION_DENY":        1,
		"ACTION_PERMIT":      2,
	}
)

Enum value maps for Action.

View Source
var (
	Mode_name = map[int32]string{
		0: "MODE_UNSPECIFIED",
		1: "MODE_READ",
		2: "MODE_WRITE",
	}
	Mode_value = map[string]int32{
		"MODE_UNSPECIFIED": 0,
		"MODE_READ":        1,
		"MODE_WRITE":       2,
	}
)

Enum value maps for Mode.

View Source
var File_github_com_openconfig_gnsi_pathz_pathz_proto protoreflect.FileDescriptor
View Source
var Pathz_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "gnsi.pathz.v1.Pathz",
	HandlerType: (*PathzServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Probe",
			Handler:    _Pathz_Probe_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _Pathz_Get_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Rotate",
			Handler:       _Pathz_Rotate_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "github.com/openconfig/gnsi/pathz/pathz.proto",
}

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

Functions

func RegisterPathzServer

func RegisterPathzServer(s grpc.ServiceRegistrar, srv PathzServer)

Types

type Action

type Action int32
const (
	Action_ACTION_UNSPECIFIED Action = 0
	Action_ACTION_DENY        Action = 1
	Action_ACTION_PERMIT      Action = 2
)

func (Action) Descriptor

func (Action) Descriptor() protoreflect.EnumDescriptor

func (Action) Enum

func (x Action) Enum() *Action

func (Action) EnumDescriptor deprecated

func (Action) EnumDescriptor() ([]byte, []int)

Deprecated: Use Action.Descriptor instead.

func (Action) Number

func (x Action) Number() protoreflect.EnumNumber

func (Action) String

func (x Action) String() string

func (Action) Type

func (Action) Type() protoreflect.EnumType

type AuthorizationPolicy

type AuthorizationPolicy struct {
	Rules  []*AuthorizationRule `protobuf:"bytes,1,rep,name=rules,proto3" json:"rules,omitempty"`
	Groups []*Group             `protobuf:"bytes,2,rep,name=groups,proto3" json:"groups,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthorizationPolicy) Descriptor deprecated

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

Deprecated: Use AuthorizationPolicy.ProtoReflect.Descriptor instead.

func (*AuthorizationPolicy) GetGroups

func (x *AuthorizationPolicy) GetGroups() []*Group

func (*AuthorizationPolicy) GetRules

func (x *AuthorizationPolicy) GetRules() []*AuthorizationRule

func (*AuthorizationPolicy) ProtoMessage

func (*AuthorizationPolicy) ProtoMessage()

func (*AuthorizationPolicy) ProtoReflect

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

func (*AuthorizationPolicy) Reset

func (x *AuthorizationPolicy) Reset()

func (*AuthorizationPolicy) String

func (x *AuthorizationPolicy) String() string

type AuthorizationRule

type AuthorizationRule struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// Types that are assignable to Principal:
	//
	//	*AuthorizationRule_User
	//	*AuthorizationRule_Group
	Principal isAuthorizationRule_Principal `protobuf_oneof:"principal"`
	Path      *gnmi.Path                    `protobuf:"bytes,4,opt,name=path,proto3" json:"path,omitempty"`
	Action    Action                        `protobuf:"varint,5,opt,name=action,proto3,enum=gnsi.pathz.v1.Action" json:"action,omitempty"`
	Mode      Mode                          `protobuf:"varint,6,opt,name=mode,proto3,enum=gnsi.pathz.v1.Mode" json:"mode,omitempty"`
	// contains filtered or unexported fields
}

func (*AuthorizationRule) Descriptor deprecated

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

Deprecated: Use AuthorizationRule.ProtoReflect.Descriptor instead.

func (*AuthorizationRule) GetAction

func (x *AuthorizationRule) GetAction() Action

func (*AuthorizationRule) GetGroup

func (x *AuthorizationRule) GetGroup() string

func (*AuthorizationRule) GetId

func (x *AuthorizationRule) GetId() string

func (*AuthorizationRule) GetMode

func (x *AuthorizationRule) GetMode() Mode

func (*AuthorizationRule) GetPath

func (x *AuthorizationRule) GetPath() *gnmi.Path

func (*AuthorizationRule) GetPrincipal

func (m *AuthorizationRule) GetPrincipal() isAuthorizationRule_Principal

func (*AuthorizationRule) GetUser

func (x *AuthorizationRule) GetUser() string

func (*AuthorizationRule) ProtoMessage

func (*AuthorizationRule) ProtoMessage()

func (*AuthorizationRule) ProtoReflect

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

func (*AuthorizationRule) Reset

func (x *AuthorizationRule) Reset()

func (*AuthorizationRule) String

func (x *AuthorizationRule) String() string

type AuthorizationRule_Group

type AuthorizationRule_Group struct {
	Group string `protobuf:"bytes,3,opt,name=group,proto3,oneof"`
}

type AuthorizationRule_User

type AuthorizationRule_User struct {
	User string `protobuf:"bytes,2,opt,name=user,proto3,oneof"`
}

type FinalizeRequest

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

func (*FinalizeRequest) Descriptor deprecated

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

Deprecated: Use FinalizeRequest.ProtoReflect.Descriptor instead.

func (*FinalizeRequest) ProtoMessage

func (*FinalizeRequest) ProtoMessage()

func (*FinalizeRequest) ProtoReflect

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

func (*FinalizeRequest) Reset

func (x *FinalizeRequest) Reset()

func (*FinalizeRequest) String

func (x *FinalizeRequest) String() string

type GetRequest

type GetRequest struct {
	PolicyInstance PolicyInstance `` /* 138-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*GetRequest) Descriptor deprecated

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

Deprecated: Use GetRequest.ProtoReflect.Descriptor instead.

func (*GetRequest) GetPolicyInstance

func (x *GetRequest) GetPolicyInstance() PolicyInstance

func (*GetRequest) ProtoMessage

func (*GetRequest) ProtoMessage()

func (*GetRequest) ProtoReflect

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

func (*GetRequest) Reset

func (x *GetRequest) Reset()

func (*GetRequest) String

func (x *GetRequest) String() string

type GetResponse

type GetResponse struct {
	Version   string               `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	CreatedOn uint64               `protobuf:"varint,2,opt,name=created_on,json=createdOn,proto3" json:"created_on,omitempty"`
	Policy    *AuthorizationPolicy `protobuf:"bytes,3,opt,name=policy,proto3" json:"policy,omitempty"`
	// contains filtered or unexported fields
}

func (*GetResponse) Descriptor deprecated

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

Deprecated: Use GetResponse.ProtoReflect.Descriptor instead.

func (*GetResponse) GetCreatedOn

func (x *GetResponse) GetCreatedOn() uint64

func (*GetResponse) GetPolicy

func (x *GetResponse) GetPolicy() *AuthorizationPolicy

func (*GetResponse) GetVersion

func (x *GetResponse) GetVersion() string

func (*GetResponse) ProtoMessage

func (*GetResponse) ProtoMessage()

func (*GetResponse) ProtoReflect

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

func (*GetResponse) Reset

func (x *GetResponse) Reset()

func (*GetResponse) String

func (x *GetResponse) String() string

type Group

type Group struct {
	Name  string  `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Users []*User `protobuf:"bytes,2,rep,name=users,proto3" json:"users,omitempty"`
	// contains filtered or unexported fields
}

func (*Group) Descriptor deprecated

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

Deprecated: Use Group.ProtoReflect.Descriptor instead.

func (*Group) GetName

func (x *Group) GetName() string

func (*Group) GetUsers

func (x *Group) GetUsers() []*User

func (*Group) ProtoMessage

func (*Group) ProtoMessage()

func (*Group) ProtoReflect

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

func (*Group) Reset

func (x *Group) Reset()

func (*Group) String

func (x *Group) String() string

type Mode

type Mode int32
const (
	Mode_MODE_UNSPECIFIED Mode = 0
	Mode_MODE_READ        Mode = 1
	Mode_MODE_WRITE       Mode = 2
)

func (Mode) Descriptor

func (Mode) Descriptor() protoreflect.EnumDescriptor

func (Mode) Enum

func (x Mode) Enum() *Mode

func (Mode) EnumDescriptor deprecated

func (Mode) EnumDescriptor() ([]byte, []int)

Deprecated: Use Mode.Descriptor instead.

func (Mode) Number

func (x Mode) Number() protoreflect.EnumNumber

func (Mode) String

func (x Mode) String() string

func (Mode) Type

func (Mode) Type() protoreflect.EnumType

type PathzClient

type PathzClient interface {
	Rotate(ctx context.Context, opts ...grpc.CallOption) (Pathz_RotateClient, error)
	Probe(ctx context.Context, in *ProbeRequest, opts ...grpc.CallOption) (*ProbeResponse, error)
	Get(ctx context.Context, in *GetRequest, opts ...grpc.CallOption) (*GetResponse, error)
}

PathzClient is the client API for Pathz 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.

func NewPathzClient

func NewPathzClient(cc grpc.ClientConnInterface) PathzClient

type PathzServer

type PathzServer interface {
	Rotate(Pathz_RotateServer) error
	Probe(context.Context, *ProbeRequest) (*ProbeResponse, error)
	Get(context.Context, *GetRequest) (*GetResponse, error)
	// contains filtered or unexported methods
}

PathzServer is the server API for Pathz service. All implementations must embed UnimplementedPathzServer for forward compatibility

type Pathz_RotateClient

type Pathz_RotateClient interface {
	Send(*RotateRequest) error
	Recv() (*RotateResponse, error)
	grpc.ClientStream
}

type Pathz_RotateServer

type Pathz_RotateServer interface {
	Send(*RotateResponse) error
	Recv() (*RotateRequest, error)
	grpc.ServerStream
}

type PolicyInstance

type PolicyInstance int32
const (
	PolicyInstance_POLICY_INSTANCE_UNSPECIFIED PolicyInstance = 0
	PolicyInstance_POLICY_INSTANCE_ACTIVE      PolicyInstance = 1
	PolicyInstance_POLICY_INSTANCE_SANDBOX     PolicyInstance = 2
)

func (PolicyInstance) Descriptor

func (PolicyInstance) Enum

func (x PolicyInstance) Enum() *PolicyInstance

func (PolicyInstance) EnumDescriptor deprecated

func (PolicyInstance) EnumDescriptor() ([]byte, []int)

Deprecated: Use PolicyInstance.Descriptor instead.

func (PolicyInstance) Number

func (PolicyInstance) String

func (x PolicyInstance) String() string

func (PolicyInstance) Type

type ProbeRequest

type ProbeRequest struct {
	User           string         `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	Path           *gnmi.Path     `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"`
	Mode           Mode           `protobuf:"varint,3,opt,name=mode,proto3,enum=gnsi.pathz.v1.Mode" json:"mode,omitempty"`
	PolicyInstance PolicyInstance `` /* 138-byte string literal not displayed */
	// contains filtered or unexported fields
}

func (*ProbeRequest) Descriptor deprecated

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

Deprecated: Use ProbeRequest.ProtoReflect.Descriptor instead.

func (*ProbeRequest) GetMode

func (x *ProbeRequest) GetMode() Mode

func (*ProbeRequest) GetPath

func (x *ProbeRequest) GetPath() *gnmi.Path

func (*ProbeRequest) GetPolicyInstance

func (x *ProbeRequest) GetPolicyInstance() PolicyInstance

func (*ProbeRequest) GetUser

func (x *ProbeRequest) GetUser() string

func (*ProbeRequest) ProtoMessage

func (*ProbeRequest) ProtoMessage()

func (*ProbeRequest) ProtoReflect

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

func (*ProbeRequest) Reset

func (x *ProbeRequest) Reset()

func (*ProbeRequest) String

func (x *ProbeRequest) String() string

type ProbeResponse

type ProbeResponse struct {
	Action  Action `protobuf:"varint,1,opt,name=action,proto3,enum=gnsi.pathz.v1.Action" json:"action,omitempty"`
	Version string `protobuf:"bytes,2,opt,name=version,proto3" json:"version,omitempty"`
	// contains filtered or unexported fields
}

func (*ProbeResponse) Descriptor deprecated

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

Deprecated: Use ProbeResponse.ProtoReflect.Descriptor instead.

func (*ProbeResponse) GetAction

func (x *ProbeResponse) GetAction() Action

func (*ProbeResponse) GetVersion

func (x *ProbeResponse) GetVersion() string

func (*ProbeResponse) ProtoMessage

func (*ProbeResponse) ProtoMessage()

func (*ProbeResponse) ProtoReflect

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

func (*ProbeResponse) Reset

func (x *ProbeResponse) Reset()

func (*ProbeResponse) String

func (x *ProbeResponse) String() string

type RotateRequest

type RotateRequest struct {

	// Types that are assignable to RotateRequest:
	//
	//	*RotateRequest_UploadRequest
	//	*RotateRequest_FinalizeRotation
	RotateRequest  isRotateRequest_RotateRequest `protobuf_oneof:"rotate_request"`
	ForceOverwrite bool                          `protobuf:"varint,3,opt,name=force_overwrite,json=forceOverwrite,proto3" json:"force_overwrite,omitempty"`
	// contains filtered or unexported fields
}

func (*RotateRequest) Descriptor deprecated

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

Deprecated: Use RotateRequest.ProtoReflect.Descriptor instead.

func (*RotateRequest) GetFinalizeRotation

func (x *RotateRequest) GetFinalizeRotation() *FinalizeRequest

func (*RotateRequest) GetForceOverwrite

func (x *RotateRequest) GetForceOverwrite() bool

func (*RotateRequest) GetRotateRequest

func (m *RotateRequest) GetRotateRequest() isRotateRequest_RotateRequest

func (*RotateRequest) GetUploadRequest

func (x *RotateRequest) GetUploadRequest() *UploadRequest

func (*RotateRequest) ProtoMessage

func (*RotateRequest) ProtoMessage()

func (*RotateRequest) ProtoReflect

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

func (*RotateRequest) Reset

func (x *RotateRequest) Reset()

func (*RotateRequest) String

func (x *RotateRequest) String() string

type RotateRequest_FinalizeRotation

type RotateRequest_FinalizeRotation struct {
	FinalizeRotation *FinalizeRequest `protobuf:"bytes,2,opt,name=finalize_rotation,json=finalizeRotation,proto3,oneof"`
}

type RotateRequest_UploadRequest

type RotateRequest_UploadRequest struct {
	UploadRequest *UploadRequest `protobuf:"bytes,1,opt,name=upload_request,json=uploadRequest,proto3,oneof"`
}

type RotateResponse

type RotateResponse struct {

	// Types that are assignable to Response:
	//
	//	*RotateResponse_Upload
	Response isRotateResponse_Response `protobuf_oneof:"response"`
	// contains filtered or unexported fields
}

func (*RotateResponse) Descriptor deprecated

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

Deprecated: Use RotateResponse.ProtoReflect.Descriptor instead.

func (*RotateResponse) GetResponse added in v0.2.1

func (m *RotateResponse) GetResponse() isRotateResponse_Response

func (*RotateResponse) GetUpload added in v0.2.1

func (x *RotateResponse) GetUpload() *UploadResponse

func (*RotateResponse) ProtoMessage

func (*RotateResponse) ProtoMessage()

func (*RotateResponse) ProtoReflect

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

func (*RotateResponse) Reset

func (x *RotateResponse) Reset()

func (*RotateResponse) String

func (x *RotateResponse) String() string

type RotateResponse_Upload added in v0.2.1

type RotateResponse_Upload struct {
	Upload *UploadResponse `protobuf:"bytes,1,opt,name=upload,proto3,oneof"`
}

type UnimplementedPathzServer

type UnimplementedPathzServer struct {
}

UnimplementedPathzServer must be embedded to have forward compatible implementations.

func (UnimplementedPathzServer) Get

func (UnimplementedPathzServer) Probe

func (UnimplementedPathzServer) Rotate

type UnsafePathzServer

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

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

type UploadRequest

type UploadRequest struct {
	Version   string               `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"`
	CreatedOn uint64               `protobuf:"varint,2,opt,name=created_on,json=createdOn,proto3" json:"created_on,omitempty"`
	Policy    *AuthorizationPolicy `protobuf:"bytes,3,opt,name=policy,proto3" json:"policy,omitempty"`
	// contains filtered or unexported fields
}

func (*UploadRequest) Descriptor deprecated

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

Deprecated: Use UploadRequest.ProtoReflect.Descriptor instead.

func (*UploadRequest) GetCreatedOn

func (x *UploadRequest) GetCreatedOn() uint64

func (*UploadRequest) GetPolicy

func (x *UploadRequest) GetPolicy() *AuthorizationPolicy

func (*UploadRequest) GetVersion

func (x *UploadRequest) GetVersion() string

func (*UploadRequest) ProtoMessage

func (*UploadRequest) ProtoMessage()

func (*UploadRequest) ProtoReflect

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

func (*UploadRequest) Reset

func (x *UploadRequest) Reset()

func (*UploadRequest) String

func (x *UploadRequest) String() string

type UploadResponse

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

func (*UploadResponse) Descriptor deprecated

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

Deprecated: Use UploadResponse.ProtoReflect.Descriptor instead.

func (*UploadResponse) ProtoMessage

func (*UploadResponse) ProtoMessage()

func (*UploadResponse) ProtoReflect

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

func (*UploadResponse) Reset

func (x *UploadResponse) Reset()

func (*UploadResponse) String

func (x *UploadResponse) String() string

type User

type User struct {
	Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*User) Descriptor deprecated

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetName

func (x *User) GetName() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

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

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

Jump to

Keyboard shortcuts

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