v1

package
v0.88.9 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package v1 is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Package auth/v1 contains the API of Auth services.

Index

Constants

View Source
const (
	// APIID contains identifier of this API
	APIID = "auth/v1"
	// APIMajorVersion contains major version of this API
	APIMajorVersion = 1
	// APIMinorVersion contains minor version of this API
	APIMinorVersion = 0
	// APIPatchVersion contains patch version of this API
	APIPatchVersion = 2
)

Variables

View Source
var (
	ErrInvalidLengthAuth        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAuth          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupAuth = fmt.Errorf("proto: unexpected end of group")
)

Functions

func RegisterAuthServiceHandler

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

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

func RegisterAuthServiceHandlerClient

func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error

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

func RegisterAuthServiceHandlerFromEndpoint

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

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

func RegisterAuthServiceHandlerServer

func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error

RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux". UnaryRPC :call AuthServiceServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.

func RegisterAuthServiceServer

func RegisterAuthServiceServer(s *grpc.Server, srv AuthServiceServer)

Types

type AuthServiceClient

type AuthServiceClient interface {
	// Get the current API version of this service.
	// Required permissions:
	// - None (authenticated only)
	GetAPIVersion(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Version, error)
	// Verify the current user based on JWT token provided in the request header
	// Verify if the resource URI in request is allowed for a given user
	// If the permission is allowed,
	// Set cookie (arango_graph_[env]]) in response for resource URL
	// Redirect user to callback_url in the request
	// Required permissions:
	// - None (since the subject is always the authenticated user).
	Authorize(ctx context.Context, in *AuthorizeRequest, opts ...grpc.CallOption) (*v1.Empty, error)
	// Logout the user from auth dashboard by deleting the cookie
	// - None (since the subject is always the authenticated user).
	Logout(ctx context.Context, in *v1.Empty, opts ...grpc.CallOption) (*v1.Empty, error)
}

AuthServiceClient is the client API for AuthService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewAuthServiceClient

func NewAuthServiceClient(cc *grpc.ClientConn) AuthServiceClient

type AuthServiceServer

type AuthServiceServer interface {
	// Get the current API version of this service.
	// Required permissions:
	// - None (authenticated only)
	GetAPIVersion(context.Context, *v1.Empty) (*v1.Version, error)
	// Verify the current user based on JWT token provided in the request header
	// Verify if the resource URI in request is allowed for a given user
	// If the permission is allowed,
	// Set cookie (arango_graph_[env]]) in response for resource URL
	// Redirect user to callback_url in the request
	// Required permissions:
	// - None (since the subject is always the authenticated user).
	Authorize(context.Context, *AuthorizeRequest) (*v1.Empty, error)
	// Logout the user from auth dashboard by deleting the cookie
	// - None (since the subject is always the authenticated user).
	Logout(context.Context, *v1.Empty) (*v1.Empty, error)
}

AuthServiceServer is the server API for AuthService service.

type AuthorizeRequest

type AuthorizeRequest struct {
	// Resource identifier, example (notebook id)
	ResourceId string `protobuf:"bytes,1,opt,name=resource_id,json=resourceId,proto3" json:"resource_id,omitempty"`
	// Resource Type is the kind of resource
	ResourceType string `protobuf:"bytes,2,opt,name=resource_type,json=resourceType,proto3" json:"resource_type,omitempty"`
	// Endpoint of a resource
	CallbackUrl          string   `protobuf:"bytes,3,opt,name=callback_url,json=callbackUrl,proto3" json:"callback_url,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

Request arguments for Authorize

func (*AuthorizeRequest) Descriptor

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

func (*AuthorizeRequest) GetCallbackUrl

func (m *AuthorizeRequest) GetCallbackUrl() string

func (*AuthorizeRequest) GetResourceId

func (m *AuthorizeRequest) GetResourceId() string

func (*AuthorizeRequest) GetResourceType

func (m *AuthorizeRequest) GetResourceType() string

func (*AuthorizeRequest) Marshal

func (m *AuthorizeRequest) Marshal() (dAtA []byte, err error)

func (*AuthorizeRequest) MarshalTo

func (m *AuthorizeRequest) MarshalTo(dAtA []byte) (int, error)

func (*AuthorizeRequest) MarshalToSizedBuffer

func (m *AuthorizeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*AuthorizeRequest) ProtoMessage

func (*AuthorizeRequest) ProtoMessage()

func (*AuthorizeRequest) Reset

func (m *AuthorizeRequest) Reset()

func (*AuthorizeRequest) Size

func (m *AuthorizeRequest) Size() (n int)

func (*AuthorizeRequest) String

func (m *AuthorizeRequest) String() string

func (*AuthorizeRequest) Unmarshal

func (m *AuthorizeRequest) Unmarshal(dAtA []byte) error

func (*AuthorizeRequest) XXX_DiscardUnknown

func (m *AuthorizeRequest) XXX_DiscardUnknown()

func (*AuthorizeRequest) XXX_Marshal

func (m *AuthorizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*AuthorizeRequest) XXX_Merge

func (m *AuthorizeRequest) XXX_Merge(src proto.Message)

func (*AuthorizeRequest) XXX_Size

func (m *AuthorizeRequest) XXX_Size() int

func (*AuthorizeRequest) XXX_Unmarshal

func (m *AuthorizeRequest) XXX_Unmarshal(b []byte) error

type UnimplementedAuthServiceServer

type UnimplementedAuthServiceServer struct {
}

UnimplementedAuthServiceServer can be embedded to have forward compatible implementations.

func (*UnimplementedAuthServiceServer) Authorize

func (*UnimplementedAuthServiceServer) GetAPIVersion

func (*UnimplementedAuthServiceServer) GetAPIVersion(ctx context.Context, req *v1.Empty) (*v1.Version, error)

func (*UnimplementedAuthServiceServer) Logout added in v0.79.4

Jump to

Keyboard shortcuts

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