iam

package
v0.0.0-...-eb9f531 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package iam is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

This section is empty.

Variables

View Source
var File_iam_iam_proto protoreflect.FileDescriptor

Functions

func RegisterResonateIAMHandler

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

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

func RegisterResonateIAMHandlerClient

func RegisterResonateIAMHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ResonateIAMClient) error

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

func RegisterResonateIAMHandlerFromEndpoint

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

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

func RegisterResonateIAMHandlerServer

func RegisterResonateIAMHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ResonateIAMServer) error

RegisterResonateIAMHandlerServer registers the http handlers for service ResonateIAM to "mux". UnaryRPC :call ResonateIAMServer 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 RegisterResonateIAMHandlerFromEndpoint instead.

func RegisterResonateIAMServer

func RegisterResonateIAMServer(s grpc.ServiceRegistrar, srv ResonateIAMServer)

Types

type AuthReq

type AuthReq struct {

	// Required
	Auth string `protobuf:"bytes,1,opt,name=auth,proto3" json:"auth,omitempty"`
	// Required
	Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
	// contains filtered or unexported fields
}

Password authentication request

func (*AuthReq) Descriptor deprecated

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

Deprecated: Use AuthReq.ProtoReflect.Descriptor instead.

func (*AuthReq) GetAuth

func (x *AuthReq) GetAuth() string

func (*AuthReq) GetPassword

func (x *AuthReq) GetPassword() string

func (*AuthReq) ProtoMessage

func (*AuthReq) ProtoMessage()

func (*AuthReq) ProtoReflect

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

func (*AuthReq) Reset

func (x *AuthReq) Reset()

func (*AuthReq) String

func (x *AuthReq) String() string

func (*AuthReq) Validate

func (this *AuthReq) Validate() error

type AuthResp

type AuthResp struct {

	// Access token
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// Refresh token
	RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`
	// contains filtered or unexported fields
}

Password authentication response

func (*AuthResp) Descriptor deprecated

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

Deprecated: Use AuthResp.ProtoReflect.Descriptor instead.

func (*AuthResp) GetRefreshToken

func (x *AuthResp) GetRefreshToken() string

func (*AuthResp) GetToken

func (x *AuthResp) GetToken() string

func (*AuthResp) ProtoMessage

func (*AuthResp) ProtoMessage()

func (*AuthResp) ProtoReflect

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

func (*AuthResp) Reset

func (x *AuthResp) Reset()

func (*AuthResp) String

func (x *AuthResp) String() string

func (*AuthResp) Validate

func (this *AuthResp) Validate() error

type RefreshReq

type RefreshReq struct {

	// Required
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

Refresh token request

func (*RefreshReq) Descriptor deprecated

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

Deprecated: Use RefreshReq.ProtoReflect.Descriptor instead.

func (*RefreshReq) GetToken

func (x *RefreshReq) GetToken() string

func (*RefreshReq) ProtoMessage

func (*RefreshReq) ProtoMessage()

func (*RefreshReq) ProtoReflect

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

func (*RefreshReq) Reset

func (x *RefreshReq) Reset()

func (*RefreshReq) String

func (x *RefreshReq) String() string

func (*RefreshReq) Validate

func (this *RefreshReq) Validate() error

type RefreshResp

type RefreshResp struct {

	// Access token
	Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
	// contains filtered or unexported fields
}

Refresh token response

func (*RefreshResp) Descriptor deprecated

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

Deprecated: Use RefreshResp.ProtoReflect.Descriptor instead.

func (*RefreshResp) GetToken

func (x *RefreshResp) GetToken() string

func (*RefreshResp) ProtoMessage

func (*RefreshResp) ProtoMessage()

func (*RefreshResp) ProtoReflect

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

func (*RefreshResp) Reset

func (x *RefreshResp) Reset()

func (*RefreshResp) String

func (x *RefreshResp) String() string

func (*RefreshResp) Validate

func (this *RefreshResp) Validate() error

type ResonateIAMClient

type ResonateIAMClient interface {
	// Authenticate user by username or email and password
	Auth(ctx context.Context, in *AuthReq, opts ...grpc.CallOption) (*AuthResp, error)
	// Refresh refreshes JWT token
	Refresh(ctx context.Context, in *RefreshReq, opts ...grpc.CallOption) (*RefreshResp, error)
}

ResonateIAMClient is the client API for ResonateIAM 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 ResonateIAMServer

type ResonateIAMServer interface {
	// Authenticate user by username or email and password
	Auth(context.Context, *AuthReq) (*AuthResp, error)
	// Refresh refreshes JWT token
	Refresh(context.Context, *RefreshReq) (*RefreshResp, error)
}

ResonateIAMServer is the server API for ResonateIAM service. All implementations should embed UnimplementedResonateIAMServer for forward compatibility

type UnimplementedResonateIAMServer

type UnimplementedResonateIAMServer struct {
}

UnimplementedResonateIAMServer should be embedded to have forward compatible implementations.

func (UnimplementedResonateIAMServer) Auth

func (UnimplementedResonateIAMServer) Refresh

type UnsafeResonateIAMServer

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

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

Jump to

Keyboard shortcuts

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