Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions internal/binaries/tls-keygen/storage/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func (r *RemoteStorage) Load(domain string) (ChainPEM, Metadata, error) {
return nil, Metadata{}, err
}
req.Header.Set(instanceHeader, token)
req.Header.Set("x-client-id", "tls-keygen")

resp, err := r.httpClient().Do(req)
if err != nil {
Expand Down Expand Up @@ -150,6 +151,7 @@ func (r *RemoteStorage) Store(domain string, chain ChainPEM) error {
}
req.Header.Set(instanceHeader, token)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("x-client-id", "tls-keygen")

resp, err := r.httpClient().Do(req)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/commands/app/info.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func listAction(cCtx *cli.Context) error {

userApiClient, err := utils.NewUserApiClient(cCtx)
if err != nil {
return fmt.Errorf("failed to get KMS client: %w", err)
return fmt.Errorf("failed to get userApi client: %w", err)
}

// Get environment config for context
Expand Down
5 changes: 5 additions & 0 deletions pkg/commands/utils/userapi_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strings"
"time"

"github.com/Layr-Labs/eigenx-cli/internal/version"
"github.com/Layr-Labs/eigenx-cli/pkg/common"
kmscrypto "github.com/Layr-Labs/eigenx-kms/pkg/crypto"
kmstypes "github.com/Layr-Labs/eigenx-kms/pkg/types"
Expand Down Expand Up @@ -326,6 +327,10 @@ func (cc *UserApiClient) makeAuthenticatedRequest(cCtx *cli.Context, method, url
return nil, fmt.Errorf("failed to create request: %w", err)
}

// Add x-client-id header to identify the CLI client
clientID := fmt.Sprintf("eigenx-cli/%s", version.GetVersion())
req.Header.Set("x-client-id", clientID)

// Add auth headers if permission is specified
if permission != nil {
expiry := big.NewInt(time.Now().Add(5 * time.Minute).Unix())
Expand Down
Binary file modified tools/tls-keygen-linux-amd64
Binary file not shown.
Loading