glauth

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package glauth provides authorization for each GRPC method in MServiceLedger. The JWT extracted from the GRPC request context is used for each delegating method.

Index

Constants

This section is empty.

Variables

View Source
var NotImplemented = errors.New("not implemented")

Functions

func GetInt64FromClaims

func GetInt64FromClaims(claims *map[string]interface{}, key string) int64

Get the clain value as an int64.

func GetStringFromClaims

func GetStringFromClaims(claims *map[string]interface{}, key string) string

Get the claim value as a string.

Types

type GlAuth added in v0.9.2

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

func NewLedgerAuth

func NewLedgerAuth(glService pb.MServiceLedgerServer) *GlAuth

Get a new projAuth instance.

func (*GlAuth) AddTransactionDetails added in v0.9.2

add transaction details

func (*GlAuth) CreateAccount added in v0.9.2

func (s *GlAuth) CreateAccount(ctx context.Context, req *pb.CreateAccountRequest) (*pb.CreateAccountResponse, error)

create general ledger account

func (*GlAuth) CreateAccountType added in v0.9.2

func (s *GlAuth) CreateAccountType(ctx context.Context, req *pb.CreateAccountTypeRequest) (*pb.CreateAccountTypeResponse, error)

create general ledger account type

func (*GlAuth) CreateOrganization added in v0.9.2

create a new general ledger organization

func (*GlAuth) CreateParty added in v0.9.2

func (s *GlAuth) CreateParty(ctx context.Context, req *pb.CreatePartyRequest) (*pb.CreatePartyResponse, error)

create general ledger party

func (*GlAuth) CreateTransaction added in v0.9.2

func (s *GlAuth) CreateTransaction(ctx context.Context, req *pb.CreateTransactionRequest) (*pb.CreateTransactionResponse, error)

create general ledger transaction

func (*GlAuth) CreateTransactionType added in v0.9.2

create general ledger transaction type

func (*GlAuth) DeleteAccount added in v0.9.2

func (s *GlAuth) DeleteAccount(ctx context.Context, req *pb.DeleteAccountRequest) (*pb.DeleteAccountResponse, error)

delete general ledger account

func (*GlAuth) DeleteAccountType added in v0.9.2

func (s *GlAuth) DeleteAccountType(ctx context.Context, req *pb.DeleteAccountTypeRequest) (*pb.DeleteAccountTypeResponse, error)

delete general ledger account type

func (*GlAuth) DeleteOrganization added in v0.9.2

delete an existing general ledger organization

func (*GlAuth) DeleteParty added in v0.9.2

func (s *GlAuth) DeleteParty(ctx context.Context, req *pb.DeletePartyRequest) (*pb.DeletePartyResponse, error)

delete general ledger party

func (*GlAuth) DeleteTransaction added in v0.9.2

func (s *GlAuth) DeleteTransaction(ctx context.Context, req *pb.DeleteTransactionRequest) (*pb.DeleteTransactionResponse, error)

delete general ledger transaction

func (*GlAuth) DeleteTransactionType added in v0.9.2

delete general ledger transaction type

func (*GlAuth) GetAccountById added in v0.9.2

func (s *GlAuth) GetAccountById(ctx context.Context, req *pb.GetAccountByIdRequest) (*pb.GetAccountByIdResponse, error)

get general ledger account by id

func (*GlAuth) GetAccountTypeById added in v0.9.2

get general ledger account type by id

func (*GlAuth) GetAccountTypesByMservice added in v0.9.2

get general ledger account types by mservice

func (*GlAuth) GetAccountsByOrganization added in v0.9.2

get general ledger accounts by organization

func (*GlAuth) GetJwtFromContext added in v0.9.2

func (s *GlAuth) GetJwtFromContext(ctx context.Context) (*map[string]interface{}, error)

Get the JWT from the gRPC request context.

func (*GlAuth) GetOrganizationById added in v0.9.2

get general ledger organization by id

func (*GlAuth) GetOrganizationsByMservice added in v0.9.2

get general ledger organizations by mservice

func (*GlAuth) GetPartiesByMservice added in v0.9.2

get general ledger parties by mservice

func (*GlAuth) GetPartyById added in v0.9.2

func (s *GlAuth) GetPartyById(ctx context.Context, req *pb.GetPartyByIdRequest) (*pb.GetPartyByIdResponse, error)

get general ledger party by id

func (*GlAuth) GetServerVersion added in v0.9.2

func (s *GlAuth) GetServerVersion(ctx context.Context, req *pb.GetServerVersionRequest) (*pb.GetServerVersionResponse, error)

get current server version and uptime - health check

func (*GlAuth) GetTransactionById added in v0.9.2

get general ledger transaction by id

func (*GlAuth) GetTransactionTypeById added in v0.9.2

get general ledger transaction type by id

func (*GlAuth) GetTransactionTypesByMservice added in v0.9.2

get general ledger transaction types by mservice

func (*GlAuth) GetTransactionWrapperById added in v0.9.2

get general ledger transaction wrapper by id

func (*GlAuth) GetTransactionWrappersByDate added in v0.9.2

get general ledger transaction wrappers by date

func (*GlAuth) HasAdminAccess added in v0.9.2

func (s *GlAuth) HasAdminAccess(ctx context.Context) (bool, int64)

func (*GlAuth) HasReadOnlyAccess added in v0.9.2

func (s *GlAuth) HasReadOnlyAccess(ctx context.Context) (bool, int64)

func (*GlAuth) HasReadWriteAccess added in v0.9.2

func (s *GlAuth) HasReadWriteAccess(ctx context.Context) (bool, int64)

func (*GlAuth) IsTokenExpired added in v0.9.2

func (s *GlAuth) IsTokenExpired(ctx context.Context) bool

check to see if JWT token is expired

func (*GlAuth) NewApiServer added in v0.9.2

func (s *GlAuth) NewApiServer(gServer *grpc.Server) error

Bind our glAuth as the gRPC api server.

func (*GlAuth) SetDatabaseConnection added in v0.9.2

func (s *GlAuth) SetDatabaseConnection(sqlDB *sql.DB)

Set the database connection for the projAuth instance.

func (*GlAuth) SetLogger added in v0.9.2

func (s *GlAuth) SetLogger(logger log.Logger)

Set the logger for the glAuth instance.

func (*GlAuth) SetPublicKey added in v0.9.2

func (s *GlAuth) SetPublicKey(publicKeyFile string) error

Set the public RSA key for the projAuth instance, used to validate JWT.

func (*GlAuth) UpdateAccount added in v0.9.2

func (s *GlAuth) UpdateAccount(ctx context.Context, req *pb.UpdateAccountRequest) (*pb.UpdateAccountResponse, error)

update general ledger account

func (*GlAuth) UpdateAccountType added in v0.9.2

func (s *GlAuth) UpdateAccountType(ctx context.Context, req *pb.UpdateAccountTypeRequest) (*pb.UpdateAccountTypeResponse, error)

update general ledger account type

func (*GlAuth) UpdateOrganization added in v0.9.2

update an existing general ledger organization

func (*GlAuth) UpdateParty added in v0.9.2

func (s *GlAuth) UpdateParty(ctx context.Context, req *pb.UpdatePartyRequest) (*pb.UpdatePartyResponse, error)

update general ledger party

func (*GlAuth) UpdateTransaction added in v0.9.2

func (s *GlAuth) UpdateTransaction(ctx context.Context, req *pb.UpdateTransactionRequest) (*pb.UpdateTransactionResponse, error)

update general ledger transaction

func (*GlAuth) UpdateTransactionType added in v0.9.2

update general ledger transaction type

Jump to

Keyboard shortcuts

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