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 ¶
- Variables
- func GetInt64FromClaims(claims *map[string]interface{}, key string) int64
- func GetStringFromClaims(claims *map[string]interface{}, key string) string
- type GlAuth
- func (s *GlAuth) AddTransactionDetails(ctx context.Context, req *pb.AddTransactionDetailsRequest) (*pb.AddTransactionDetailsResponse, error)
- func (s *GlAuth) CreateAccount(ctx context.Context, req *pb.CreateAccountRequest) (*pb.CreateAccountResponse, error)
- func (s *GlAuth) CreateAccountType(ctx context.Context, req *pb.CreateAccountTypeRequest) (*pb.CreateAccountTypeResponse, error)
- func (s *GlAuth) CreateOrganization(ctx context.Context, req *pb.CreateOrganizationRequest) (*pb.CreateOrganizationResponse, error)
- func (s *GlAuth) CreateParty(ctx context.Context, req *pb.CreatePartyRequest) (*pb.CreatePartyResponse, error)
- func (s *GlAuth) CreateTransaction(ctx context.Context, req *pb.CreateTransactionRequest) (*pb.CreateTransactionResponse, error)
- func (s *GlAuth) CreateTransactionType(ctx context.Context, req *pb.CreateTransactionTypeRequest) (*pb.CreateTransactionTypeResponse, error)
- func (s *GlAuth) DeleteAccount(ctx context.Context, req *pb.DeleteAccountRequest) (*pb.DeleteAccountResponse, error)
- func (s *GlAuth) DeleteAccountType(ctx context.Context, req *pb.DeleteAccountTypeRequest) (*pb.DeleteAccountTypeResponse, error)
- func (s *GlAuth) DeleteOrganization(ctx context.Context, req *pb.DeleteOrganizationRequest) (*pb.DeleteOrganizationResponse, error)
- func (s *GlAuth) DeleteParty(ctx context.Context, req *pb.DeletePartyRequest) (*pb.DeletePartyResponse, error)
- func (s *GlAuth) DeleteTransaction(ctx context.Context, req *pb.DeleteTransactionRequest) (*pb.DeleteTransactionResponse, error)
- func (s *GlAuth) DeleteTransactionType(ctx context.Context, req *pb.DeleteTransactionTypeRequest) (*pb.DeleteTransactionTypeResponse, error)
- func (s *GlAuth) GetAccountById(ctx context.Context, req *pb.GetAccountByIdRequest) (*pb.GetAccountByIdResponse, error)
- func (s *GlAuth) GetAccountTypeById(ctx context.Context, req *pb.GetAccountTypeByIdRequest) (*pb.GetAccountTypeByIdResponse, error)
- func (s *GlAuth) GetAccountTypesByMservice(ctx context.Context, req *pb.GetAccountTypesByMserviceRequest) (*pb.GetAccountTypesByMserviceResponse, error)
- func (s *GlAuth) GetAccountsByOrganization(ctx context.Context, req *pb.GetAccountsByOrganizationRequest) (*pb.GetAccountsByOrganizationResponse, error)
- func (s *GlAuth) GetJwtFromContext(ctx context.Context) (*map[string]interface{}, error)
- func (s *GlAuth) GetOrganizationById(ctx context.Context, req *pb.GetOrganizationByIdRequest) (*pb.GetOrganizationByIdResponse, error)
- func (s *GlAuth) GetOrganizationsByMservice(ctx context.Context, req *pb.GetOrganizationsByMserviceRequest) (*pb.GetOrganizationsByMserviceResponse, error)
- func (s *GlAuth) GetPartiesByMservice(ctx context.Context, req *pb.GetPartiesByMserviceRequest) (*pb.GetPartiesByMserviceResponse, error)
- func (s *GlAuth) GetPartyById(ctx context.Context, req *pb.GetPartyByIdRequest) (*pb.GetPartyByIdResponse, error)
- func (s *GlAuth) GetServerVersion(ctx context.Context, req *pb.GetServerVersionRequest) (*pb.GetServerVersionResponse, error)
- func (s *GlAuth) GetTransactionById(ctx context.Context, req *pb.GetTransactionByIdRequest) (*pb.GetTransactionByIdResponse, error)
- func (s *GlAuth) GetTransactionTypeById(ctx context.Context, req *pb.GetTransactionTypeByIdRequest) (*pb.GetTransactionTypeByIdResponse, error)
- func (s *GlAuth) GetTransactionTypesByMservice(ctx context.Context, req *pb.GetTransactionTypesByMserviceRequest) (*pb.GetTransactionTypesByMserviceResponse, error)
- func (s *GlAuth) GetTransactionWrapperById(ctx context.Context, req *pb.GetTransactionWrapperByIdRequest) (*pb.GetTransactionWrapperByIdResponse, error)
- func (s *GlAuth) GetTransactionWrappersByDate(ctx context.Context, req *pb.GetTransactionWrappersByDateRequest) (*pb.GetTransactionWrappersByDateResponse, error)
- func (s *GlAuth) HasAdminAccess(ctx context.Context) (bool, int64)
- func (s *GlAuth) HasReadOnlyAccess(ctx context.Context) (bool, int64)
- func (s *GlAuth) HasReadWriteAccess(ctx context.Context) (bool, int64)
- func (s *GlAuth) IsTokenExpired(ctx context.Context) bool
- func (s *GlAuth) NewApiServer(gServer *grpc.Server) error
- func (s *GlAuth) SetDatabaseConnection(sqlDB *sql.DB)
- func (s *GlAuth) SetLogger(logger log.Logger)
- func (s *GlAuth) SetPublicKey(publicKeyFile string) error
- func (s *GlAuth) UpdateAccount(ctx context.Context, req *pb.UpdateAccountRequest) (*pb.UpdateAccountResponse, error)
- func (s *GlAuth) UpdateAccountType(ctx context.Context, req *pb.UpdateAccountTypeRequest) (*pb.UpdateAccountTypeResponse, error)
- func (s *GlAuth) UpdateOrganization(ctx context.Context, req *pb.UpdateOrganizationRequest) (*pb.UpdateOrganizationResponse, error)
- func (s *GlAuth) UpdateParty(ctx context.Context, req *pb.UpdatePartyRequest) (*pb.UpdatePartyResponse, error)
- func (s *GlAuth) UpdateTransaction(ctx context.Context, req *pb.UpdateTransactionRequest) (*pb.UpdateTransactionResponse, error)
- func (s *GlAuth) UpdateTransactionType(ctx context.Context, req *pb.UpdateTransactionTypeRequest) (*pb.UpdateTransactionTypeResponse, error)
Constants ¶
This section is empty.
Variables ¶
var NotImplemented = errors.New("not implemented")
Functions ¶
func GetInt64FromClaims ¶
Get the clain value as an int64.
func GetStringFromClaims ¶
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
func (s *GlAuth) AddTransactionDetails(ctx context.Context, req *pb.AddTransactionDetailsRequest) (*pb.AddTransactionDetailsResponse, error)
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
func (s *GlAuth) CreateOrganization(ctx context.Context, req *pb.CreateOrganizationRequest) (*pb.CreateOrganizationResponse, error)
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
func (s *GlAuth) CreateTransactionType(ctx context.Context, req *pb.CreateTransactionTypeRequest) (*pb.CreateTransactionTypeResponse, error)
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
func (s *GlAuth) DeleteOrganization(ctx context.Context, req *pb.DeleteOrganizationRequest) (*pb.DeleteOrganizationResponse, error)
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
func (s *GlAuth) DeleteTransactionType(ctx context.Context, req *pb.DeleteTransactionTypeRequest) (*pb.DeleteTransactionTypeResponse, error)
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
func (s *GlAuth) GetAccountTypeById(ctx context.Context, req *pb.GetAccountTypeByIdRequest) (*pb.GetAccountTypeByIdResponse, error)
get general ledger account type by id
func (*GlAuth) GetAccountTypesByMservice ¶ added in v0.9.2
func (s *GlAuth) GetAccountTypesByMservice(ctx context.Context, req *pb.GetAccountTypesByMserviceRequest) (*pb.GetAccountTypesByMserviceResponse, error)
get general ledger account types by mservice
func (*GlAuth) GetAccountsByOrganization ¶ added in v0.9.2
func (s *GlAuth) GetAccountsByOrganization(ctx context.Context, req *pb.GetAccountsByOrganizationRequest) (*pb.GetAccountsByOrganizationResponse, error)
get general ledger accounts by organization
func (*GlAuth) GetJwtFromContext ¶ added in v0.9.2
Get the JWT from the gRPC request context.
func (*GlAuth) GetOrganizationById ¶ added in v0.9.2
func (s *GlAuth) GetOrganizationById(ctx context.Context, req *pb.GetOrganizationByIdRequest) (*pb.GetOrganizationByIdResponse, error)
get general ledger organization by id
func (*GlAuth) GetOrganizationsByMservice ¶ added in v0.9.2
func (s *GlAuth) GetOrganizationsByMservice(ctx context.Context, req *pb.GetOrganizationsByMserviceRequest) (*pb.GetOrganizationsByMserviceResponse, error)
get general ledger organizations by mservice
func (*GlAuth) GetPartiesByMservice ¶ added in v0.9.2
func (s *GlAuth) GetPartiesByMservice(ctx context.Context, req *pb.GetPartiesByMserviceRequest) (*pb.GetPartiesByMserviceResponse, error)
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
func (s *GlAuth) GetTransactionById(ctx context.Context, req *pb.GetTransactionByIdRequest) (*pb.GetTransactionByIdResponse, error)
get general ledger transaction by id
func (*GlAuth) GetTransactionTypeById ¶ added in v0.9.2
func (s *GlAuth) GetTransactionTypeById(ctx context.Context, req *pb.GetTransactionTypeByIdRequest) (*pb.GetTransactionTypeByIdResponse, error)
get general ledger transaction type by id
func (*GlAuth) GetTransactionTypesByMservice ¶ added in v0.9.2
func (s *GlAuth) GetTransactionTypesByMservice(ctx context.Context, req *pb.GetTransactionTypesByMserviceRequest) (*pb.GetTransactionTypesByMserviceResponse, error)
get general ledger transaction types by mservice
func (*GlAuth) GetTransactionWrapperById ¶ added in v0.9.2
func (s *GlAuth) GetTransactionWrapperById(ctx context.Context, req *pb.GetTransactionWrapperByIdRequest) (*pb.GetTransactionWrapperByIdResponse, error)
get general ledger transaction wrapper by id
func (*GlAuth) GetTransactionWrappersByDate ¶ added in v0.9.2
func (s *GlAuth) GetTransactionWrappersByDate(ctx context.Context, req *pb.GetTransactionWrappersByDateRequest) (*pb.GetTransactionWrappersByDateResponse, error)
get general ledger transaction wrappers by date
func (*GlAuth) HasAdminAccess ¶ added in v0.9.2
func (*GlAuth) HasReadOnlyAccess ¶ added in v0.9.2
func (*GlAuth) HasReadWriteAccess ¶ added in v0.9.2
func (*GlAuth) IsTokenExpired ¶ added in v0.9.2
check to see if JWT token is expired
func (*GlAuth) NewApiServer ¶ added in v0.9.2
Bind our glAuth as the gRPC api server.
func (*GlAuth) SetDatabaseConnection ¶ added in v0.9.2
Set the database connection for the projAuth instance.
func (*GlAuth) SetPublicKey ¶ added in v0.9.2
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
func (s *GlAuth) UpdateOrganization(ctx context.Context, req *pb.UpdateOrganizationRequest) (*pb.UpdateOrganizationResponse, error)
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
func (s *GlAuth) UpdateTransactionType(ctx context.Context, req *pb.UpdateTransactionTypeRequest) (*pb.UpdateTransactionTypeResponse, error)
update general ledger transaction type