Skip to content

Commit 7a80628

Browse files
fix(catalog): remove gap interceptor support (#244)
Gap interceptors were actually never used in CLD since the relevant headers are injected in the proxy instead of at the code level. We can remove the gap interceptors. CLD has already removed the usage [here](smartcontractkit/chainlink-deployments@95aefae)
1 parent fd5722d commit 7a80628

File tree

4 files changed

+0
-437
lines changed

4 files changed

+0
-437
lines changed

datastore/catalog/grpc.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,16 @@ import (
77
"google.golang.org/grpc/credentials"
88

99
datastore "github.com/smartcontractkit/chainlink-deployments-framework/datastore/catalog/internal/protos"
10-
cldf_grpc "github.com/smartcontractkit/chainlink-deployments-framework/internal/grpc"
1110
)
1211

1312
type CatalogClient struct {
1413
GRPC string
1514
datastore.DeploymentsDatastoreClient
1615
}
1716

18-
type GAPConfig struct {
19-
Token string
20-
Repository string
21-
}
22-
2317
type CatalogConfig struct {
2418
GRPC string
2519
Creds credentials.TransportCredentials
26-
GAP *GAPConfig
2720
}
2821

2922
// NewCatalogClient creates a new CatalogClient with the provided configuration.
@@ -49,12 +42,6 @@ func newCatalogConnection(cfg CatalogConfig) (*grpc.ClientConn, error) {
4942
opts = append(opts, grpc.WithTransportCredentials(cfg.Creds))
5043
}
5144

52-
if cfg.GAP != nil && cfg.GAP.Token != "" && cfg.GAP.Repository != "" {
53-
interceptors = append(interceptors,
54-
cldf_grpc.GapTokenInterceptor(cfg.GAP.Token),
55-
cldf_grpc.GapRepositoryInterceptor(cfg.GAP.Repository))
56-
}
57-
5845
if len(interceptors) > 0 {
5946
opts = append(opts, grpc.WithChainUnaryInterceptor(interceptors...))
6047
}

datastore/catalog/grpc_test.go

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -26,42 +26,6 @@ func TestNewCatalogClient_Success(t *testing.T) {
2626
},
2727
expectError: false,
2828
},
29-
{
30-
name: "config_with_gap_token_only",
31-
config: catalog.CatalogConfig{
32-
GRPC: "localhost:9090",
33-
Creds: insecure.NewCredentials(),
34-
GAP: &catalog.GAPConfig{
35-
Token: "test-token",
36-
Repository: "",
37-
},
38-
},
39-
expectError: false,
40-
},
41-
{
42-
name: "config_with_gap_repository_only",
43-
config: catalog.CatalogConfig{
44-
GRPC: "localhost:9090",
45-
Creds: insecure.NewCredentials(),
46-
GAP: &catalog.GAPConfig{
47-
Token: "",
48-
Repository: "test-repo",
49-
},
50-
},
51-
expectError: false,
52-
},
53-
{
54-
name: "full_config",
55-
config: catalog.CatalogConfig{
56-
GRPC: "localhost:9090",
57-
Creds: insecure.NewCredentials(),
58-
GAP: &catalog.GAPConfig{
59-
Token: "test-token",
60-
Repository: "test-repo",
61-
},
62-
},
63-
expectError: false,
64-
},
6529
{
6630
name: "no_transport_credentials",
6731
config: catalog.CatalogConfig{

internal/grpc/gap.go

Lines changed: 0 additions & 40 deletions
This file was deleted.

0 commit comments

Comments
 (0)