certmanager update

This commit is contained in:
Олег Бородин
2024-08-10 14:46:26 +02:00
parent 1314355110
commit cab7eac36e
3 changed files with 224 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
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{}
userID, err := hand.Authentificate(ctx)
if err != nil {
return res, err
}
res, err = hand.lg.SetGrant(ctx, userID, 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{}
userID, err := hand.Authentificate(ctx)
if err != nil {
return res, err
}
res, err = hand.lg.DeleteGrant(ctx, userID, params)
return res, err
}