zrok/agent/releaseAccess.go

20 lines
550 B
Go
Raw Normal View History

2024-09-17 04:13:12 +02:00
package agent
import (
"context"
"github.com/openziti/zrok/agent/agentGrpc"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
2024-09-18 17:54:37 +02:00
func (i *agentGrpcImpl) ReleaseAccess(_ context.Context, req *agentGrpc.ReleaseAccessRequest) (*agentGrpc.ReleaseAccessResponse, error) {
2024-09-25 17:06:06 +02:00
if acc, found := i.agent.accesses[req.FrontendToken]; found {
i.agent.rmAccess <- acc
2024-09-17 04:13:12 +02:00
logrus.Infof("released access '%v'", acc.frontendToken)
2024-09-17 04:13:12 +02:00
} else {
return nil, errors.Errorf("agent has no access with frontend token '%v'", req.FrontendToken)
}
return nil, nil
}