Skip to content

Commit

Permalink
remove automatic token creation
Browse files Browse the repository at this point in the history
  • Loading branch information
djelusic committed Feb 28, 2022
1 parent eccced0 commit da4b157
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 19 deletions.
3 changes: 0 additions & 3 deletions cli/controller/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,6 @@ func (c *Setup) create(n *domain.Node) error {
}
n.Endpoints.Rest = rsp.APIGatewayRestURL
n.CliRole = rsp.CliRole
if n.GitHubAuthEnabled {
n.JWT = rsp.JWT
}
infrastructureDuration := tmr()

log.Event(domain.Event{NodeCreate: &domain.NodeEvent{
Expand Down
15 changes: 0 additions & 15 deletions node/api/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ import (
"context"
"errors"
"fmt"
"time"

"github.com/mantil-io/mantil/domain"
"github.com/mantil-io/mantil/kit/aws"
"github.com/mantil-io/mantil/kit/token"
"github.com/mantil-io/mantil/node/dto"
Expand Down Expand Up @@ -141,25 +139,12 @@ func (s *Setup) terraformCreate(req *dto.SetupRequest) (*dto.SetupResponse, erro
if err != nil {
return nil, err
}
jwt, err := s.generateJWT(privateKey)
if err != nil {
return nil, err
}
return &dto.SetupResponse{
APIGatewayRestURL: url,
CliRole: cliRole,
JWT: jwt,
}, nil
}

func (s *Setup) generateJWT(privateKey string) (string, error) {
claims := &domain.AccessTokenClaims{
Username: "user",
Role: domain.Owner,
}
return token.JWT(privateKey, claims, 7*24*time.Hour)
}

func (s *Setup) terraformDestroy(req *dto.SetupDestroyRequest) error {
data := terraform.SetupTemplateData{
Bucket: req.Bucket,
Expand Down
1 change: 0 additions & 1 deletion node/dto/dto.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,4 @@ type SetupDestroyRequest struct {
type SetupResponse struct {
APIGatewayRestURL string
CliRole string
JWT string
}

0 comments on commit da4b157

Please sign in to comment.