API for authenticate/deauthenticate (#151)

* Creating the authentication API.
This commit is contained in:
Todd Knight authored and GitHub committed 2020-06-26 15:41:08 -07:00
1 parent d8f11af4d7
commit 08e9a027fa
7 files changed
+1274 -64

No files matched your search

@@ -12,6 +12,8 @@ import (
"github.com/hashicorp/watchtower/internal/servers/controller/common"
"github.com/hashicorp/watchtower/internal/servers/controller/handlers"
"github.com/hashicorp/watchtower/internal/types/scope"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/wrapperspb"
)
@@ -57,6 +59,16 @@ func (s Service) GetOrganization(ctx context.Context, req *pbs.GetOrganizationRe
return &pbs.GetOrganizationResponse{Item: o}, nil
}
// Authenticate implements the interface pbs.OrganizationServiceServer.
func (s Service) Authenticate(ctx context.Context, req *pbs.AuthenticateRequest) (*pbs.AuthenticateResponse, error) {
return nil, status.Error(codes.Unimplemented, "Requested method is unimplemented for Organization.")
}
// Deauthenticate implements the interface pbs.OrganizationServiceServer.
func (s Service) Deauthenticate(ctx context.Context, req *pbs.DeauthenticateRequest) (*pbs.DeauthenticateResponse, error) {
return nil, status.Error(codes.Unimplemented, "Requested method is unimplemented for Organization.")
}
func (s Service) getFromRepo(ctx context.Context, id string) (*pb.Organization, error) {
repo, err := s.repo()
if err != nil {