github.com/timoth-y/kicksware-api/order-service@v0.0.0-20201002192818-87b546a7ae5a/usecase/business/authService.go (about)

     1  package business
     2  
     3  import (
     4  	"crypto/rsa"
     5  
     6  	"github.com/timoth-y/kicksware-api/service-common/util"
     7  
     8  	"github.com/timoth-y/kicksware-api/order-service/core/service"
     9  	"github.com/timoth-y/kicksware-api/order-service/env"
    10  )
    11  
    12  type authService struct {
    13  	publicKey *rsa.PublicKey
    14  }
    15  
    16  func NewAuthService(authConfig env.AuthConfig) service.AuthService {
    17  	return &authService{
    18  		util.GetPublicKey(authConfig.PublicKeyPath),
    19  	}
    20  }
    21  
    22  func (s *authService) PublicKey() *rsa.PublicKey {
    23  	return s.publicKey
    24  }