func (s *AppidAdapter) HandleAuthnZ(ctx context.Context, r *authnz.HandleAuthnZRequest) (*authnz.HandleAuthnZResponse, error) {
	if err := validateAuthnzRequest(r); err != nil {
		zap.S().Errorf("Unexpected template format for HandleAuthnZRequest: %v", r)
		return nil, err
	}
	action, err := s.engine.Evaluate(r.Instance.Target)
	if err != nil {
		zap.L().Debug("Could not check policies", zap.Error(err))
		return nil, err
	}
	switch action.Type {
	case policy.JWT:
		zap.L().Info("Executing JWT policies")
		return s.apistrategy.HandleAuthnZRequest(r, action)
	case policy.OIDC:
		zap.L().Info("Executing OIDC policies")
		return s.webstrategy.HandleAuthnZRequest(r, action)
	default:
		zap.L().Info("No OIDC/JWT policies configured")
		return &authnz.HandleAuthnZResponse{
			Result: &v1beta1.CheckResult{Status: status.OK},
		}, nil
	}
}
//////////////// adapter.Handler //////////////////////////
HandleAuthnZ evaluates authn/z policies using api/web strategy
package adapter
import (
	"context"
	"errors"
	"fmt"
	"net"
	"strings"
	"go.uber.org/zap"
	"google.golang.org/grpc"
	"istio.io/api/mixer/adapter/model/v1beta1"
	"istio.io/istio/mixer/pkg/status"
	"github.com/ibm-cloud-security/app-identity-and-access-adapter/adapter/config"
	"github.com/ibm-cloud-security/app-identity-and-access-adapter/adapter/policy"
	"github.com/ibm-cloud-security/app-identity-and-access-adapter/adapter/policy/engine"
	"github.com/ibm-cloud-security/app-identity-and-access-adapter/adapter/policy/initializer"
	storePolicy "github.com/ibm-cloud-security/app-identity-and-access-adapter/adapter/policy/store/policy"
	"github.com/ibm-cloud-security/app-identity-and-access-adapter/adapter/strategy"
	"github.com/ibm-cloud-security/app-identity-and-access-adapter/adapter/strategy/api"
	"github.com/ibm-cloud-security/app-identity-and-access-adapter/adapter/strategy/web"
	"github.com/ibm-cloud-security/app-identity-and-access-adapter/config/template"
)
type (
	Server interface {
		Addr() string
		Close() error
		Run(shutdown chan error)
	}
	AppidAdapter struct {
		listener    net.Listener
		server      *grpc.Server
		apistrategy strategy.Strategy
		webstrategy strategy.Strategy
		engine      engine.PolicyEngine
	}
)