Skip to content

Commit

Permalink
feat: add api access restriction
Browse files Browse the repository at this point in the history
implement ENG-3911
  • Loading branch information
cowan-macady committed Jun 10, 2024
1 parent ceef944 commit ca2d71d
Show file tree
Hide file tree
Showing 25 changed files with 14,900 additions and 20,819 deletions.
48 changes: 26 additions & 22 deletions config/application_agent_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,13 @@ var _ = Describe("ApplicationAgent", func() {
},
&configpb.ReadApplicationAgentResponse{
ApplicationAgent: &configpb.ApplicationAgent{
Id: "gid:like-real-application-agent-id",
Name: "like-real-application-agent-name",
DisplayName: "Like Real Application Agent Name",
CreatedBy: "creator",
CreateTime: timestamppb.Now(),
ApplicationId: "gid:like-real-application-id",
Id: "gid:like-real-application-agent-id",
Name: "like-real-application-agent-name",
DisplayName: "Like Real Application Agent Name",
CreatedBy: "creator",
CreateTime: timestamppb.Now(),
ApplicationId: "gid:like-real-application-id",
ApiAccessRestriction: []string{"indykite.*"},
},
},
),
Expand All @@ -115,12 +116,13 @@ var _ = Describe("ApplicationAgent", func() {
},
&configpb.ReadApplicationAgentResponse{
ApplicationAgent: &configpb.ApplicationAgent{
Id: "gid:like-real-application-agent-id",
Name: "like-real-application-agent-name",
DisplayName: "Like Real Application Agent Name",
CreatedBy: "creator",
CreateTime: timestamppb.Now(),
ApplicationId: "gid:like-real-application-id",
Id: "gid:like-real-application-agent-id",
Name: "like-real-application-agent-name",
DisplayName: "Like Real Application Agent Name",
CreatedBy: "creator",
CreateTime: timestamppb.Now(),
ApplicationId: "gid:like-real-application-id",
ApiAccessRestriction: []string{"indykite.*"},
},
},
),
Expand Down Expand Up @@ -176,9 +178,10 @@ var _ = Describe("ApplicationAgent", func() {
It("Create", func() {
displayNamePb := &wrapperspb.StringValue{Value: "Like real Application Agent Name"}
req := &configpb.CreateApplicationAgentRequest{
ApplicationId: "gid:like-real-application-id",
Name: "like-real-application-agent-name",
DisplayName: displayNamePb,
ApplicationId: "gid:like-real-application-id",
Name: "like-real-application-agent-name",
DisplayName: displayNamePb,
ApiPermissions: []string{"indykite.*", "indykite.tda.*"},
}
beResp := &configpb.CreateApplicationAgentResponse{
Id: "gid:like-real-application-agent-id",
Expand Down Expand Up @@ -340,13 +343,14 @@ var _ = Describe("ApplicationAgent", func() {

mockResp := &configpb.ListApplicationAgentsResponse{
ApplicationAgent: &configpb.ApplicationAgent{
Id: "gid:like-real-applicationagent-id",
Name: "like-real-applicationagent-name",
DisplayName: "Like Real ApplicationAgent Name",
CreatedBy: "creator",
CreateTime: timestamppb.Now(),
Etag: "123qwert",
ApplicationId: "gid:like-real-application-id",
Id: "gid:like-real-applicationagent-id",
Name: "like-real-applicationagent-name",
DisplayName: "Like Real ApplicationAgent Name",
CreatedBy: "creator",
CreateTime: timestamppb.Now(),
Etag: "123qwert",
ApplicationId: "gid:like-real-application-id",
ApiAccessRestriction: []string{"indykite.*"},
},
}

Expand Down
Loading

0 comments on commit ca2d71d

Please sign in to comment.