Skip to content
This repository was archived by the owner on Sep 16, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
ca1e7e4
APIGOV-28603 - https endpoint and beats dropping
sbolosan Jul 24, 2026
433d7c5
Merge branch 'main' into APIGOV-28603
sbolosan Aug 3, 2026
f85a1b7
APIGOV-28603 - update panic fix
sbolosan Aug 3, 2026
df5c6ef
Merge branch 'main' into APIGOV-28603
sbolosan Aug 5, 2026
1485888
APIGOV-28603 - move batch implementation inside sdk
sbolosan Aug 6, 2026
c6648f5
APIGOV-28603 - Fix GetAccessRequest to strip remoteApiName_ prefix
sbolosan Aug 7, 2026
06d1507
APIGOV-28603 - update rest of locations for StripSummaryEventPrefix
sbolosan Aug 7, 2026
051c120
Merge branch 'main' into APIGOV-28603
sbolosan Aug 10, 2026
ade84e7
APIGOV-28603 - update to fulfill path config from beats removal
sbolosan Aug 10, 2026
e30bd96
APIGOV-28603 - remove go ucfg
sbolosan Aug 11, 2026
ea24d11
APIGOV-28603 - config fix for v7 TA
sbolosan Aug 11, 2026
5e51b49
APIGOV-28603 - bump sdk for bringing back string value
sbolosan Aug 12, 2026
6a394e4
APIGOV-28603 - fix alias
sbolosan Aug 12, 2026
3b680c7
APIGOV-28603 - update comments
sbolosan Aug 13, 2026
48d00a1
APIGOV-28603 - remove replace for sarama
sbolosan Aug 14, 2026
a8bd02a
APIGOV-28603 - restructure based on PR review
sbolosan Aug 16, 2026
62ded1a
APIGOV-28603 - update based on PR comments
sbolosan Aug 17, 2026
4b11977
Merge branch 'main' into APIGOV-28603
sbolosan Aug 24, 2026
db0a76b
APIGOV-28603 - udpates to proxy and single entry
sbolosan Aug 28, 2026
3389eb0
APIGOV-28603 - udpate unit tests for proxy and single url
sbolosan Aug 28, 2026
8ce714c
APIGOV-28603 - udpates based on review
sbolosan Aug 28, 2026
fefa27b
APIGOV-28603 - update on vc and jc changes for https and phoenix inge…
sbolosan Sep 1, 2026
241fc22
APIGOV-28603 - updated tests to https only
sbolosan Sep 1, 2026
8c519fe
APIGOV-28603 - remove TRACEABILITY_PROTOCOL
sbolosan Sep 1, 2026
5011d8c
APIGOV-28603 - more https only udpates
sbolosan Sep 1, 2026
ac635c8
APIGOV-28603 - fix nil panic + environment event handler check
vivekschauhan Sep 2, 2026
fa03490
Merge branch 'main' into APIGOV-28603
vivekschauhan Sep 2, 2026
61dc9b5
APIGOV-28603 - fix to parse TA config
vivekschauhan Sep 2, 2026
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
36 changes: 0 additions & 36 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module github.com/Axway/agent-sdk
go 1.25.0

require (
github.com/elastic/beats/v7 v7.17.29
github.com/emicklei/proto v1.9.2
github.com/fsnotify/fsnotify v1.5.4
github.com/getkin/kin-openapi v0.144.0
Expand All @@ -30,78 +29,43 @@ require (
google.golang.org/protobuf v1.36.11
gopkg.in/h2non/gock.v1 v1.1.2
gopkg.in/yaml.v3 v3.0.1
k8s.io/apimachinery v0.22.7
)

require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/elastic/elastic-agent-client/v7 v7.17.2 // indirect
github.com/elastic/elastic-agent-libs v0.21.5 // indirect
github.com/elastic/go-licenser v0.4.2 // indirect
github.com/elastic/go-sysinfo v1.15.3 // indirect
github.com/elastic/go-ucfg v0.8.8 // indirect
github.com/elastic/go-windows v1.0.2 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/go-openapi/jsonpointer v0.22.5 // indirect
github.com/go-openapi/swag/jsonname v0.25.5 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/gofrs/uuid v4.4.0+incompatible // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/pprof v0.0.0-20250630185457-6e76a2b096b5 // indirect
Comment thread
jcollins-axway marked this conversation as resolved.
github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jcchavezs/porto v0.7.0 // indirect
github.com/joeshaw/multierror v0.0.0-20140124173710-69b34d4ec901 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/httprc v1.0.5 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/magiconair/properties v1.8.6 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mitchellh/hashstructure v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/oasdiff/yaml v0.1.1 // indirect
github.com/oasdiff/yaml3 v0.0.14 // indirect
github.com/pelletier/go-toml v1.9.5 // indirect
github.com/pelletier/go-toml/v2 v2.0.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/procfs v0.17.0 // indirect
github.com/santhosh-tekuri/jsonschema v1.2.4 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
go.elastic.co/apm v1.15.0 // indirect
go.elastic.co/ecszap v1.0.3 // indirect
go.elastic.co/fastjson v1.5.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.55.0 // indirect
golang.org/x/lint v0.0.0-20241112194109-818c5a804067 // indirect
golang.org/x/mod v0.38.0 // indirect
golang.org/x/sync v0.22.0 // indirect
golang.org/x/sys v0.47.0 // indirect
golang.org/x/telemetry v0.0.0-20260708182218-49f421fb7959 // indirect
golang.org/x/tools v0.48.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478 // indirect
gopkg.in/ini.v1 v1.66.6 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
howett.net/plist v1.0.1 // indirect
)

replace github.com/Shopify/sarama => github.com/elastic/sarama v1.19.1-0.20210823122811-11c3ef800752

retract ( // errored versions
[v1.1.35, v1.1.36]
[v1.1.21, v1.1.23]
Expand Down
177 changes: 0 additions & 177 deletions go.sum

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pkg/agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ func InitializeWithAgentFeatures(centralCfg config.CentralConfig, agentFeaturesC
centralCfg.GetAuthConfig().GetTokenURL(),
centralCfg.GetUsageReportingConfig().GetURL(),
}
if centralCfg.GetTraceabilityProtocol() == "https" {
// add the traceability host to the single entry filter for https only
if centralCfg.GetSingleURL() != "" {
// add the traceability host to the single entry filter. Ingestion is https-only
singleEntryFilter = append(singleEntryFilter, fmt.Sprintf("https://%s", centralCfg.GetTraceabilityHost()))
}
api.SetConfigAgent(
Expand Down
11 changes: 7 additions & 4 deletions pkg/agent/handler/apiservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,13 @@ func NewAPISvcHandler(agentCacheManager agentcache.Manager, envName string) Hand
}

func (h *apiSvcHandler) ShouldHandle(ctx context.Context, event *proto.Event) bool {
if event.Payload.Metadata.Scope.Name != h.envName || event.Payload.Metadata.Scope.Kind != management.EnvironmentGVK().Kind {
return false
}
return true
return shouldHandleAPIService(event, h.envName)
}

func shouldHandleAPIService(event *proto.Event, envName string) bool {
return event.Payload.Metadata.Scope != nil &&
event.Payload.Metadata.Scope.Name == envName &&
event.Payload.Metadata.Scope.Kind == management.EnvironmentGVK().Kind
}

// HandleCache adds the API Service to the cache during discoveryCache's bulk rebuild.
Expand Down
44 changes: 44 additions & 0 deletions pkg/agent/handler/apiservice_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,47 @@ func TestNewAPISvcHandler(t *testing.T) {
}

}

func TestAPISvcHandlerShouldHandle(t *testing.T) {
tests := []struct {
name string
scope *proto.Metadata_ScopeKind
expected bool
}{
{
name: "should handle an event scoped to the agent's environment",
scope: &proto.Metadata_ScopeKind{Kind: management.EnvironmentGVK().Kind, Name: "test-env"},
expected: true,
},
{
name: "should not handle an event scoped to another environment",
scope: &proto.Metadata_ScopeKind{Kind: management.EnvironmentGVK().Kind, Name: "other-env"},
expected: false,
},
{
name: "should not handle an event with no scope",
scope: nil,
expected: false,
},
}

cacheManager := agentcache.NewAgentCacheManager(&config.CentralConfiguration{}, false)

for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
handler := NewAPISvcHandler(cacheManager, "test-env")

ctx := NewEventContext(proto.Event_CREATED, nil, management.APIServiceGVK().Kind, "svc")
event := &proto.Event{
Type: proto.Event_CREATED,
Payload: &proto.ResourceInstance{
Kind: management.APIServiceGVK().Kind,
Name: "svc",
Metadata: &proto.Metadata{Scope: tc.scope},
},
}

assert.Equal(t, tc.expected, handler.ShouldHandle(ctx, event))
})
}
}
2 changes: 1 addition & 1 deletion pkg/agent/handler/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewEnvironmentHandler(agentCacheManager agentcache.Manager, credentialConfi
}

func (c *environmentHandler) ShouldHandle(ctx context.Context, event *proto.Event) bool {
if event.Payload.Metadata.Scope.Name != c.envName {
if event.Payload.Name != c.envName {
return false
}
// verify that action is subresource updated and meta subsresource is environment policy
Expand Down
71 changes: 71 additions & 0 deletions pkg/agent/handler/environment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,74 @@ func TestEnvironmentHandler(t *testing.T) {
}

}

func TestEnvironmentHandlerShouldHandle(t *testing.T) {
tests := []struct {
name string
payloadName string
scopeName string
action proto.Event_Type
subresource string
expected bool
}{
{
name: "should handle a policies subresource update on the agent's environment",
payloadName: "test-env",
scopeName: "test-env",
action: proto.Event_SUBRESOURCEUPDATED,
subresource: management.EnvironmentPoliciesSubResourceName,
expected: true,
},
{
name: "should not handle an event for another environment",
payloadName: "other-env",
scopeName: "other-env",
action: proto.Event_SUBRESOURCEUPDATED,
subresource: management.EnvironmentPoliciesSubResourceName,
expected: false,
},
{
name: "should not handle an action other than a subresource update",
payloadName: "test-env",
scopeName: "test-env",
action: proto.Event_UPDATED,
subresource: management.EnvironmentPoliciesSubResourceName,
expected: false,
},
{
name: "should not handle a subresource update for another subresource",
payloadName: "test-env",
scopeName: "test-env",
action: proto.Event_SUBRESOURCEUPDATED,
subresource: "status",
expected: false,
},
}

cacheManager := agentcache.NewAgentCacheManager(&config.CentralConfiguration{}, false)

for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
handler := NewEnvironmentHandler(cacheManager, &config.CredentialConfiguration{}, "test-env")

meta := &proto.EventMeta{Subresource: tc.subresource}
ctx := NewEventContext(tc.action, meta, management.EnvironmentGVK().Kind, tc.payloadName)
event := &proto.Event{
Type: tc.action,
Metadata: meta,
Payload: &proto.ResourceInstance{
Kind: management.EnvironmentGVK().Kind,
Name: tc.payloadName,
Metadata: &proto.Metadata{
Scope: &proto.Metadata_ScopeKind{
Kind: management.EnvironmentGVK().Kind,
Name: tc.scopeName,
},
},
},
}

assert.Equal(t, tc.expected, handler.ShouldHandle(ctx, event))
})
}
}
6 changes: 1 addition & 5 deletions pkg/agent/handler/instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ func NewInstanceHandler(agentCacheManager agentcache.Manager, envName string) Ha
}

func (h *instanceHandler) ShouldHandle(ctx context.Context, event *proto.Event) bool {
if event.Payload.Metadata.Scope.Name != h.envName {
return false
}

return true
return shouldHandleAPIService(event, h.envName)
}

// HandleCache adds the API Service Instance to the cache during discoveryCache's bulk rebuild.
Expand Down
44 changes: 44 additions & 0 deletions pkg/agent/handler/instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,47 @@ func TestNewInstanceHandler(t *testing.T) {
}

}

func TestInstanceHandlerShouldHandle(t *testing.T) {
tests := []struct {
name string
scope *proto.Metadata_ScopeKind
expected bool
}{
{
name: "should handle an event scoped to the agent's environment",
scope: &proto.Metadata_ScopeKind{Kind: management.EnvironmentGVK().Kind, Name: "test-env"},
expected: true,
},
{
name: "should not handle an event scoped to another environment",
scope: &proto.Metadata_ScopeKind{Kind: management.EnvironmentGVK().Kind, Name: "other-env"},
expected: false,
},
{
name: "should not handle an event with no scope",
scope: nil,
expected: false,
},
}

cacheManager := agentcache.NewAgentCacheManager(&config.CentralConfiguration{}, false)

for _, tc := range tests {
t.Run(tc.name, func(t *testing.T) {
handler := NewInstanceHandler(cacheManager, "test-env")

ctx := NewEventContext(proto.Event_CREATED, nil, management.APIServiceInstanceGVK().Kind, "inst")
event := &proto.Event{
Type: proto.Event_CREATED,
Payload: &proto.ResourceInstance{
Kind: management.APIServiceInstanceGVK().Kind,
Name: "inst",
Metadata: &proto.Metadata{Scope: tc.scope},
},
}

assert.Equal(t, tc.expected, handler.ShouldHandle(ctx, event))
})
}
}
2 changes: 1 addition & 1 deletion pkg/agent/resource/manager_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package resource

import (
"encoding/json"
"fmt"
"strconv"
"testing"
Expand All @@ -16,7 +17,6 @@ import (
management "github.com/Axway/agent-sdk/pkg/apic/apiserver/models/management/v1"
"github.com/Axway/agent-sdk/pkg/config"
"github.com/stretchr/testify/assert"
"k8s.io/apimachinery/pkg/util/json"
)

func createDiscoveryAgentRes(id, name, dataplane, teamID string) *v1.ResourceInstance {
Expand Down
Loading
Loading