Skip to content

Commit 6872c33

Browse files
committed
bumping protos + PR feedback
1 parent f397286 commit 6872c33

4 files changed

Lines changed: 8 additions & 8 deletions

File tree

pkg/billing/workflow_client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ import (
1111
"google.golang.org/grpc/metadata"
1212
"google.golang.org/protobuf/types/known/emptypb"
1313

14+
"github.com/smartcontractkit/chainlink-common/pkg/logger"
15+
nodeauthgrpc "github.com/smartcontractkit/chainlink-common/pkg/nodeauth/grpc"
1416
auth "github.com/smartcontractkit/chainlink-common/pkg/nodeauth/jwt"
1517
pb "github.com/smartcontractkit/chainlink-protos/billing/go"
16-
17-
"github.com/smartcontractkit/chainlink-common/pkg/logger"
1818
)
1919

2020
// WorkflowClient is a specialized interface for the Workflow node use-case.
@@ -139,7 +139,7 @@ func (wc *workflowClient) addJWTAuth(ctx context.Context, req any) (context.Cont
139139
}
140140

141141
// Add JWT to Authorization header
142-
return metadata.AppendToOutgoingContext(ctx, "authorization", "Bearer "+jwtToken), nil
142+
return metadata.AppendToOutgoingContext(ctx, nodeauthgrpc.AuthorizationHeader, nodeauthgrpc.BearerPrefix+jwtToken), nil
143143
}
144144

145145
func (wc *workflowClient) GetOrganizationCreditsByWorkflow(ctx context.Context, req *pb.GetOrganizationCreditsByWorkflowRequest) (*pb.GetOrganizationCreditsByWorkflowResponse, error) {

pkg/services/orgresolver/linking.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"google.golang.org/grpc/metadata"
1212

1313
log "github.com/smartcontractkit/chainlink-common/pkg/logger"
14+
nodeauthgrpc "github.com/smartcontractkit/chainlink-common/pkg/nodeauth/grpc"
1415
"github.com/smartcontractkit/chainlink-common/pkg/services"
1516
linkingclient "github.com/smartcontractkit/chainlink-protos/linking-service/go/v1"
1617
)
@@ -100,7 +101,7 @@ func (o *orgResolver) addJWTAuth(ctx context.Context, req any) (context.Context,
100101
}
101102

102103
// Add JWT to Authorization header
103-
return metadata.AppendToOutgoingContext(ctx, "authorization", "Bearer "+jwtToken), nil
104+
return metadata.AppendToOutgoingContext(ctx, nodeauthgrpc.AuthorizationHeader, nodeauthgrpc.BearerPrefix+jwtToken), nil
104105
}
105106

106107
func (o *orgResolver) Get(ctx context.Context, owner string) (string, error) {

pkg/workflows/grpcsource/client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import (
1010
"google.golang.org/grpc/credentials/insecure"
1111
"google.golang.org/grpc/metadata"
1212

13-
pb "github.com/smartcontractkit/chainlink-protos/workflows/go/sources"
14-
13+
nodeauthgrpc "github.com/smartcontractkit/chainlink-common/pkg/nodeauth/grpc"
1514
auth "github.com/smartcontractkit/chainlink-common/pkg/nodeauth/jwt"
15+
pb "github.com/smartcontractkit/chainlink-protos/workflows/go/sources"
1616
)
1717

1818
// Client is a GRPC client for the WorkflowMetadataSourceService.
@@ -99,7 +99,7 @@ func (c *Client) addJWTAuth(ctx context.Context, req any) (context.Context, erro
9999
return nil, fmt.Errorf("failed to create JWT: %w", err)
100100
}
101101

102-
return metadata.AppendToOutgoingContext(ctx, "authorization", "Bearer "+jwtToken), nil
102+
return metadata.AppendToOutgoingContext(ctx, nodeauthgrpc.AuthorizationHeader, nodeauthgrpc.BearerPrefix+jwtToken), nil
103103
}
104104

105105
// ListWorkflowMetadata fetches workflow metadata from the GRPC source.

pkg/workflows/privateregistry/types.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ type WorkflowDeploymentAction interface {
1010
AddWorkflow(ctx context.Context, workflow *WorkflowRegistration) error
1111

1212
// UpdateWorkflow updates the workflow's status configuration
13-
// This is idempotent - calling with the same config multiple times has the same effect
1413
UpdateWorkflow(ctx context.Context, workflowID [32]byte, config *WorkflowStatusConfig) error
1514

1615
// DeleteWorkflow removes the workflow from the source

0 commit comments

Comments
 (0)