Documentation ¶
Overview ¶
Package v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Package v1 contains the API of Auth services.
Index ¶
- Constants
- Variables
- func RegisterAuthServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error
- func RegisterAuthServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error
- func RegisterAuthServiceServer(s *grpc.Server, srv AuthServiceServer)
- type AuthServiceClient
- type AuthServiceServer
- type AuthorizeRequest
- func (*AuthorizeRequest) Descriptor() ([]byte, []int)deprecated
- func (x *AuthorizeRequest) GetCallbackUrl() string
- func (x *AuthorizeRequest) GetResourceId() string
- func (x *AuthorizeRequest) GetResourceType() string
- func (*AuthorizeRequest) ProtoMessage()
- func (x *AuthorizeRequest) ProtoReflect() protoreflect.Message
- func (x *AuthorizeRequest) Reset()
- func (x *AuthorizeRequest) String() string
- type UnimplementedAuthServiceServer
Constants ¶
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 = 1 // APIPatchVersion contains patch version of this API APIPatchVersion = 0 )
Variables ¶
var File_auth_proto protoreflect.FileDescriptor
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. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuthServiceHandlerFromEndpoint instead.
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.ClientConnInterface) 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"` // contains filtered or unexported fields }
Request arguments for Authorize
func (*AuthorizeRequest) Descriptor
deprecated
func (*AuthorizeRequest) Descriptor() ([]byte, []int)
Deprecated: Use AuthorizeRequest.ProtoReflect.Descriptor instead.
func (*AuthorizeRequest) GetCallbackUrl ¶
func (x *AuthorizeRequest) GetCallbackUrl() string
func (*AuthorizeRequest) GetResourceId ¶
func (x *AuthorizeRequest) GetResourceId() string
func (*AuthorizeRequest) GetResourceType ¶
func (x *AuthorizeRequest) GetResourceType() string
func (*AuthorizeRequest) ProtoMessage ¶
func (*AuthorizeRequest) ProtoMessage()
func (*AuthorizeRequest) ProtoReflect ¶ added in v0.89.0
func (x *AuthorizeRequest) ProtoReflect() protoreflect.Message
func (*AuthorizeRequest) Reset ¶
func (x *AuthorizeRequest) Reset()
func (*AuthorizeRequest) String ¶
func (x *AuthorizeRequest) String() string
type UnimplementedAuthServiceServer ¶
type UnimplementedAuthServiceServer struct { }
UnimplementedAuthServiceServer can be embedded to have forward compatible implementations.
func (*UnimplementedAuthServiceServer) Authorize ¶
func (*UnimplementedAuthServiceServer) Authorize(context.Context, *AuthorizeRequest) (*v1.Empty, error)