Skip to content

Commit

Permalink
remove authentication in node example
Browse files Browse the repository at this point in the history
  • Loading branch information
djelusic committed Feb 24, 2022
1 parent de49529 commit 6811c9e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 1 addition & 6 deletions cli/controller/examples/node_example.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package examples

import (
"github.com/mantil-io/mantil/cli/controller/invoke"
"github.com/mantil-io/mantil/cli/log"
"github.com/mantil-io/mantil/cli/ui"
"github.com/mantil-io/mantil/domain"
"github.com/spf13/cobra"
Expand Down Expand Up @@ -83,9 +82,5 @@ func NewProjectAddCommand() *cobra.Command {
}

func nodeInvoker(node *domain.Node) (*invoke.HTTPClient, error) {
token, err := node.AuthToken()
if err != nil {
return nil, log.Wrap(err)
}
return invoke.Node(node.Endpoints.Rest, token, ui.NodeLogsSink), nil
return invoke.Node(node.Endpoints.Rest, "", ui.NodeLogsSink), nil
}
3 changes: 3 additions & 0 deletions domain/workspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ func (n *Node) AuthToken() (string, error) {
return token.JWT(n.Keys.Private, claims, 7*24*time.Hour)
}
t := n.JWT
if t == "" {
return "", &TokenExpiredError{}
}
exp, err := token.ExpiresAt(t)
if err != nil {
return "", err
Expand Down

0 comments on commit 6811c9e

Please sign in to comment.