Skip to content
Draft
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
81 changes: 81 additions & 0 deletions helm-chart/templates/emissary-ingress/mappings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,87 @@ spec:
---
apiVersion: getambassador.io/v3alpha1
kind: Mapping
metadata:
name: plumber-public-service-accounts-mapping
namespace: {{ .Release.Namespace }}
spec:
hostname: "*"
prefix: /api/v1alpha/service_accounts
rewrite: "/service_accounts"
service: plumber-public.{{ .Release.Namespace }}:4004
timeout_ms: 5000
precedence: 100
---
apiVersion: getambassador.io/v3alpha1
kind: Mapping
metadata:
name: plumber-public-members-mapping
namespace: {{ .Release.Namespace }}
spec:
hostname: "*"
prefix: /api/v1alpha/members
rewrite: "/members"
service: plumber-public.{{ .Release.Namespace }}:4004
timeout_ms: 5000
precedence: 100
---
apiVersion: getambassador.io/v3alpha1
kind: Mapping
metadata:
name: plumber-public-roles-mapping
namespace: {{ .Release.Namespace }}
spec:
hostname: "*"
prefix: /api/v1alpha/roles
rewrite: "/roles"
service: plumber-public.{{ .Release.Namespace }}:4004
timeout_ms: 5000
precedence: 100
---
apiVersion: getambassador.io/v3alpha1
kind: Mapping
metadata:
name: plumber-public-permissions-mapping
namespace: {{ .Release.Namespace }}
spec:
hostname: "*"
prefix: /api/v1alpha/permissions
rewrite: "/permissions"
service: plumber-public.{{ .Release.Namespace }}:4004
timeout_ms: 5000
precedence: 100
---
apiVersion: getambassador.io/v3alpha1
kind: Mapping
metadata:
name: plumber-public-groups-mapping
namespace: {{ .Release.Namespace }}
spec:
hostname: "*"
prefix: /api/v1alpha/groups
rewrite: "/groups"
service: plumber-public.{{ .Release.Namespace }}:4004
timeout_ms: 5000
precedence: 100
---
apiVersion: getambassador.io/v3alpha1
kind: Mapping
metadata:
name: plumber-public-project-members-mapping
namespace: {{ .Release.Namespace }}
spec:
hostname: "*"
prefix: "/api/v1alpha/projects/.+/members"
prefix_regex: true
regex_rewrite:
pattern: "/api/v1alpha/(.*)"
substitution: "/\\1"
service: plumber-public.{{ .Release.Namespace }}:4004
timeout_ms: 5000
precedence: 200
---
apiVersion: getambassador.io/v3alpha1
kind: Mapping
metadata:
name: projecthub-public-mapping
namespace: {{ .Release.Namespace }}
Expand Down
4 changes: 4 additions & 0 deletions public-api/v1alpha/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ PERIODIC_SCHEDULER_URL?=127.0.0.1:50052
PPL_GRPC_URL?=127.0.0.1:50052
WF_GRPC_URL?=127.0.0.1:50052
SELF_HOSTED_HUB_URL?=127.0.0.1:50052
INTERNAL_API_URL_SERVICE_ACCOUNT?=127.0.0.1:50052
INTERNAL_API_URL_GROUPS?=127.0.0.1:50052
SECRETHUB_GRPC_URL?=127.0.0.1:50052
FEATURE_GRPC_URL?=127.0.0.1:50052
JOBS_API_URL?=127.0.0.1:50052
Expand Down Expand Up @@ -51,6 +53,8 @@ CONTAINER_ENV_VARS= \
-e PPL_GRPC_URL=$(PPL_GRPC_URL) \
-e WF_GRPC_URL=$(WF_GRPC_URL) \
-e SELF_HOSTED_HUB_URL=$(SELF_HOSTED_HUB_URL) \
-e INTERNAL_API_URL_SERVICE_ACCOUNT=$(INTERNAL_API_URL_SERVICE_ACCOUNT) \
-e INTERNAL_API_URL_GROUPS=$(INTERNAL_API_URL_GROUPS) \
-e SECRETHUB_GRPC_URL=$(SECRETHUB_GRPC_URL) \
-e FEATURE_GRPC_URL=$(FEATURE_GRPC_URL) \
-e JOBS_API_URL=$(JOBS_API_URL) \
Expand Down
10 changes: 10 additions & 0 deletions public-api/v1alpha/helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,16 @@ spec:
configMapKeyRef:
name: {{ .Values.global.internalApi.configMapName }}
key: INTERNAL_API_URL_RBAC
- name: INTERNAL_API_URL_GROUPS
valueFrom:
configMapKeyRef:
name: {{ .Values.global.internalApi.configMapName }}
key: INTERNAL_API_URL_GROUPS
- name: INTERNAL_API_URL_SERVICE_ACCOUNT
valueFrom:
configMapKeyRef:
name: {{ .Values.global.internalApi.configMapName }}
key: INTERNAL_API_URL_SERVICE_ACCOUNT
- name: GOFER_GRPC_URL
valueFrom:
configMapKeyRef:
Expand Down
163 changes: 163 additions & 0 deletions public-api/v1alpha/lib/internal_api/groups.pb.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
defmodule InternalApi.Groups.ListGroupsRequest do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
org_id: String.t(),
group_id: String.t(),
page: InternalApi.Groups.ListGroupsRequest.Page.t()
}
defstruct [:org_id, :group_id, :page]

field(:org_id, 1, type: :string)
field(:group_id, 2, type: :string)
field(:page, 3, type: InternalApi.Groups.ListGroupsRequest.Page)
end

defmodule InternalApi.Groups.ListGroupsRequest.Page do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
page_no: integer,
page_size: integer
}
defstruct [:page_no, :page_size]

field(:page_no, 1, type: :int32)
field(:page_size, 2, type: :int32)
end

defmodule InternalApi.Groups.ListGroupsResponse do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
groups: [InternalApi.Groups.Group.t()],
total_pages: integer
}
defstruct [:groups, :total_pages]

field(:groups, 1, repeated: true, type: InternalApi.Groups.Group)
field(:total_pages, 2, type: :int32)
end

defmodule InternalApi.Groups.CreateGroupRequest do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
group: InternalApi.Groups.Group.t(),
org_id: String.t(),
requester_id: String.t()
}
defstruct [:group, :org_id, :requester_id]

field(:group, 1, type: InternalApi.Groups.Group)
field(:org_id, 2, type: :string)
field(:requester_id, 3, type: :string)
end

defmodule InternalApi.Groups.CreateGroupResponse do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
group: InternalApi.Groups.Group.t()
}
defstruct [:group]

field(:group, 1, type: InternalApi.Groups.Group)
end

defmodule InternalApi.Groups.DestroyGroupRequest do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
group_id: String.t(),
requester_id: String.t()
}
defstruct [:group_id, :requester_id]

field(:group_id, 1, type: :string)
field(:requester_id, 2, type: :string)
end

defmodule InternalApi.Groups.DestroyGroupResponse do
@moduledoc false
use Protobuf, syntax: :proto3

defstruct []
end

defmodule InternalApi.Groups.ModifyGroupRequest do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
group: InternalApi.Groups.Group.t(),
org_id: String.t(),
requester_id: String.t(),
members_to_add: [String.t()],
members_to_remove: [String.t()]
}
defstruct [:group, :org_id, :requester_id, :members_to_add, :members_to_remove]

field(:group, 1, type: InternalApi.Groups.Group)
field(:org_id, 2, type: :string)
field(:requester_id, 3, type: :string)
field(:members_to_add, 4, repeated: true, type: :string)
field(:members_to_remove, 5, repeated: true, type: :string)
end

defmodule InternalApi.Groups.ModifyGroupResponse do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
group: InternalApi.Groups.Group.t()
}
defstruct [:group]

field(:group, 1, type: InternalApi.Groups.Group)
end

defmodule InternalApi.Groups.Group do
@moduledoc false
use Protobuf, syntax: :proto3

@type t :: %__MODULE__{
id: String.t(),
name: String.t(),
description: String.t(),
member_ids: [String.t()]
}
defstruct [:id, :name, :description, :member_ids]

field(:id, 1, type: :string)
field(:name, 2, type: :string)
field(:description, 3, type: :string)
field(:member_ids, 4, repeated: true, type: :string)
end

defmodule InternalApi.Groups.Groups.Service do
@moduledoc false
use GRPC.Service, name: "InternalApi.Groups.Groups"

rpc(:ListGroups, InternalApi.Groups.ListGroupsRequest, InternalApi.Groups.ListGroupsResponse)
rpc(:CreateGroup, InternalApi.Groups.CreateGroupRequest, InternalApi.Groups.CreateGroupResponse)

rpc(
:DestroyGroup,
InternalApi.Groups.DestroyGroupRequest,
InternalApi.Groups.DestroyGroupResponse
)

rpc(:ModifyGroup, InternalApi.Groups.ModifyGroupRequest, InternalApi.Groups.ModifyGroupResponse)
end

defmodule InternalApi.Groups.Groups.Stub do
@moduledoc false
use GRPC.Stub, service: InternalApi.Groups.Groups.Service
end
Loading