Files
certmanager/internal/grpc/handler/grant.go
Олег Бородин 0bafb086bc certmanager updates
2024-08-10 15:08:14 +02:00

32 lines
797 B
Go

package handler
import (
"context"
"certmanager/pkg/cmctl"
)
func (hand *Handler) SetGrant(ctx context.Context, params *cmctl.SetGrantParams) (*cmctl.SetGrantResult, error) {
var err error
hand.log.Debugf("Handle SetGrant call")
res := &cmctl.SetGrantResult{}
accountID, err := hand.Authentificate(ctx)
if err != nil {
return res, err
}
res, err = hand.lg.SetGrant(ctx, accountID, params)
return res, err
}
func (hand *Handler) DeleteGrant(ctx context.Context, params *cmctl.DeleteGrantParams) (*cmctl.DeleteGrantResult, error) {
var err error
hand.log.Debugf("Handle DeleteGrant call")
res := &cmctl.DeleteGrantResult{}
accountID, err := hand.Authentificate(ctx)
if err != nil {
return res, err
}
res, err = hand.lg.DeleteGrant(ctx, accountID, params)
return res, err
}