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
 - 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)
 - func (m *AuthorizeRequest) GetCallbackUrl() string
 - func (m *AuthorizeRequest) GetResourceId() string
 - func (m *AuthorizeRequest) GetResourceType() string
 - func (m *AuthorizeRequest) Marshal() (dAtA []byte, err error)
 - func (m *AuthorizeRequest) MarshalTo(dAtA []byte) (int, error)
 - func (m *AuthorizeRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
 - func (*AuthorizeRequest) ProtoMessage()
 - func (m *AuthorizeRequest) Reset()
 - func (m *AuthorizeRequest) Size() (n int)
 - func (m *AuthorizeRequest) String() string
 - func (m *AuthorizeRequest) Unmarshal(dAtA []byte) error
 - func (m *AuthorizeRequest) XXX_DiscardUnknown()
 - func (m *AuthorizeRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
 - func (m *AuthorizeRequest) XXX_Merge(src proto.Message)
 - func (m *AuthorizeRequest) XXX_Size() int
 - func (m *AuthorizeRequest) XXX_Unmarshal(b []byte) error
 
- type UnimplementedAuthServiceServer
 - func (*UnimplementedAuthServiceServer) Authorize(ctx context.Context, req *AuthorizeRequest) (*v1.Empty, error)
 - func (*UnimplementedAuthServiceServer) GetAPIVersion(ctx context.Context, req *v1.Empty) (*v1.Version, error)
 - func (*UnimplementedAuthServiceServer) Logout(ctx context.Context, req *v1.Empty) (*v1.Empty, error)
 
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 = 0 // APIPatchVersion contains patch version of this API APIPatchVersion = 2 )
Variables ¶
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) 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) Authorize(ctx context.Context, req *AuthorizeRequest) (*v1.Empty, error)