Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ spec:
{{- toYaml $config.valueFrom | nindent 16 }}
{{- end }}
{{- end }}
{{- if .Values.externalSecretsOperator.enabled }}
envFrom:
- secretRef:
name: {{ .Chart.Name }}
{{- end }}
ports:
- containerPort: {{.Values.service.port}}
name: web
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,25 @@ spec:
maxBytes: {{ .Values.nats.groupsio_services_kv_bucket.maxBytes }}
compression: {{ .Values.nats.groupsio_services_kv_bucket.compression }}
{{- end }}
{{- if .Values.nats.groupsio_service_settings_kv_bucket.creation }}
---
apiVersion: jetstream.nats.io/v1beta2
kind: KeyValue
metadata:
name: {{ .Values.nats.groupsio_service_settings_kv_bucket.name }}
namespace: {{ .Release.Namespace }}
{{- if .Values.nats.groupsio_service_settings_kv_bucket.keep }}
annotations:
"helm.sh/resource-policy": keep
{{- end }}
spec:
bucket: {{ .Values.nats.groupsio_service_settings_kv_bucket.name }}
history: {{ .Values.nats.groupsio_service_settings_kv_bucket.history }}
storage: {{ .Values.nats.groupsio_service_settings_kv_bucket.storage }}
maxValueSize: {{ .Values.nats.groupsio_service_settings_kv_bucket.maxValueSize }}
maxBytes: {{ .Values.nats.groupsio_service_settings_kv_bucket.maxBytes }}
compression: {{ .Values.nats.groupsio_service_settings_kv_bucket.compression }}
{{- end }}
{{- if .Values.nats.groupsio_mailing_lists_kv_bucket.creation }}
---
apiVersion: jetstream.nats.io/v1beta2
Expand All @@ -38,6 +57,25 @@ spec:
maxBytes: {{ .Values.nats.groupsio_mailing_lists_kv_bucket.maxBytes }}
compression: {{ .Values.nats.groupsio_mailing_lists_kv_bucket.compression }}
{{- end }}
{{- if .Values.nats.groupsio_mailing_list_settings_kv_bucket.creation }}
---
apiVersion: jetstream.nats.io/v1beta2
kind: KeyValue
metadata:
name: {{ .Values.nats.groupsio_mailing_list_settings_kv_bucket.name }}
namespace: {{ .Release.Namespace }}
{{- if .Values.nats.groupsio_mailing_list_settings_kv_bucket.keep }}
annotations:
"helm.sh/resource-policy": keep
{{- end }}
spec:
bucket: {{ .Values.nats.groupsio_mailing_list_settings_kv_bucket.name }}
history: {{ .Values.nats.groupsio_mailing_list_settings_kv_bucket.history }}
storage: {{ .Values.nats.groupsio_mailing_list_settings_kv_bucket.storage }}
maxValueSize: {{ .Values.nats.groupsio_mailing_list_settings_kv_bucket.maxValueSize }}
maxBytes: {{ .Values.nats.groupsio_mailing_list_settings_kv_bucket.maxBytes }}
compression: {{ .Values.nats.groupsio_mailing_list_settings_kv_bucket.compression }}
{{- end }}
{{- if .Values.nats.groupsio_members_kv_bucket.creation }}
---
apiVersion: jetstream.nats.io/v1beta2
Expand Down
42 changes: 42 additions & 0 deletions charts/lfx-v2-mailing-list-service/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,27 @@ nats:
# compression is a boolean to determine if the KV bucket should be compressed
compression: true

# groupsio_service_settings_kv_bucket is the configuration for the KV bucket for storing GroupsIO service settings
groupsio_service_settings_kv_bucket:
# creation is a boolean to determine if the KV bucket should be created via the helm chart.
# set it to false if you want to use an existing KV bucket.
creation: true
# keep is a boolean to determine if the KV bucket should be preserved during helm uninstall
# set it to false if you want the bucket to be deleted when the chart is uninstalled
keep: true
# name is the name of the KV bucket for storing GroupsIO service settings
name: groupsio-service-settings
# history is the number of history entries to keep for the KV bucket
history: 20
# storage is the storage type for the KV bucket
storage: file
# maxValueSize is the maximum size of a value in the KV bucket
maxValueSize: 1048576 # 1MB
# maxBytes is the maximum number of bytes in the KV bucket
maxBytes: 104857600 # 100MB
# compression is a boolean to determine if the KV bucket should be compressed
compression: true

# groupsio_mailing_lists_kv_bucket is the configuration for the KV bucket for storing GroupsIO mailing lists
groupsio_mailing_lists_kv_bucket:
# creation is a boolean to determine if the KV bucket should be created via the helm chart.
Expand All @@ -102,6 +123,27 @@ nats:
# compression is a boolean to determine if the KV bucket should be compressed
compression: true

# groupsio_mailing_list_settings_kv_bucket is the configuration for the KV bucket for storing GroupsIO mailing list settings
groupsio_mailing_list_settings_kv_bucket:
# creation is a boolean to determine if the KV bucket should be created via the helm chart.
# set it to false if you want to use an existing KV bucket.
creation: true
# keep is a boolean to determine if the KV bucket should be preserved during helm uninstall
# set it to false if you want the bucket to be deleted when the chart is uninstalled
keep: true
# name is the name of the KV bucket for storing GroupsIO mailing list settings
name: groupsio-mailing-list-settings
# history is the number of history entries to keep for the KV bucket
history: 20
# storage is the storage type for the KV bucket
storage: file
# maxValueSize is the maximum size of a value in the KV bucket
maxValueSize: 1048576 # 1MB
# maxBytes is the maximum number of bytes in the KV bucket
maxBytes: 104857600 # 100MB
# compression is a boolean to determine if the KV bucket should be compressed
compression: true

# groupsio_members_kv_bucket is the configuration for the KV bucket for storing GroupsIO members
groupsio_members_kv_bucket:
# creation is a boolean to determine if the KV bucket should be created via the helm chart.
Expand Down
139 changes: 133 additions & 6 deletions cmd/mailing-list-api/design/mailing_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ var _ = dsl.Service("mailing-list", func() {
GrpsIOServiceUIDAttribute()
GrpsIOServiceBaseAttributes()

WritersAttribute()
AuditorsAttribute()

dsl.Required("type", "project_uid", "version")
})
dsl.Result(GrpsIOServiceWithReadonlyAttributes)
Expand Down Expand Up @@ -187,6 +184,72 @@ var _ = dsl.Service("mailing-list", func() {
})
})

dsl.Method("get-grpsio-service-settings", func() {
dsl.Description("Get GroupsIO service settings (writers and auditors)")
dsl.Security(JWTAuth)
dsl.Payload(func() {
BearerTokenAttribute()
VersionAttribute()
GrpsIOServiceUIDAttribute()
})
dsl.Result(func() {
dsl.Attribute("service_settings", GrpsIOServiceSettings)
ETagAttribute()
dsl.Required("service_settings")
})
dsl.Error("BadRequest", BadRequestError, "Bad request")
dsl.Error("NotFound", NotFoundError, "Service settings not found")
dsl.Error("InternalServerError", InternalServerError, "Internal server error")
dsl.Error("ServiceUnavailable", ServiceUnavailableError, "Service unavailable")
dsl.HTTP(func() {
dsl.GET("/groupsio/services/{uid}/settings")
dsl.Param("version:v")
dsl.Param("uid")
dsl.Header("bearer_token:Authorization")
dsl.Response(dsl.StatusOK, func() {
dsl.Body("service_settings")
dsl.Header("etag:ETag")
})
dsl.Response("BadRequest", dsl.StatusBadRequest)
dsl.Response("NotFound", dsl.StatusNotFound)
dsl.Response("InternalServerError", dsl.StatusInternalServerError)
dsl.Response("ServiceUnavailable", dsl.StatusServiceUnavailable)
})
})

dsl.Method("update-grpsio-service-settings", func() {
dsl.Description("Update GroupsIO service settings (writers and auditors)")
dsl.Security(JWTAuth)
dsl.Payload(func() {
BearerTokenAttribute()
VersionAttribute()
IfMatchAttribute()
GrpsIOServiceUIDAttribute()
WritersAttribute()
AuditorsAttribute()
dsl.Required("version", "uid")
})
dsl.Result(GrpsIOServiceSettings)
dsl.Error("BadRequest", BadRequestError, "Bad request")
dsl.Error("NotFound", NotFoundError, "Service settings not found")
dsl.Error("Conflict", ConflictError, "Conflict - ETag mismatch")
dsl.Error("InternalServerError", InternalServerError, "Internal server error")
dsl.Error("ServiceUnavailable", ServiceUnavailableError, "Service unavailable")
dsl.HTTP(func() {
dsl.PUT("/groupsio/services/{uid}/settings")
dsl.Param("version:v")
dsl.Param("uid")
dsl.Header("bearer_token:Authorization")
dsl.Header("if_match:If-Match")
dsl.Response(dsl.StatusOK)
dsl.Response("BadRequest", dsl.StatusBadRequest)
dsl.Response("NotFound", dsl.StatusNotFound)
dsl.Response("Conflict", dsl.StatusConflict)
dsl.Response("InternalServerError", dsl.StatusInternalServerError)
dsl.Response("ServiceUnavailable", dsl.StatusServiceUnavailable)
})
})

// Mailing List Management endpoints
dsl.Method("create-grpsio-mailing-list", func() {
dsl.Description("Create GroupsIO mailing list/subgroup with comprehensive validation")
Expand All @@ -197,6 +260,7 @@ var _ = dsl.Service("mailing-list", func() {

GrpsIOMailingListBaseAttributes()

// Settings fields (writers and auditors) for initial mailing list setup
WritersAttribute()
AuditorsAttribute()

Expand Down Expand Up @@ -267,9 +331,6 @@ var _ = dsl.Service("mailing-list", func() {
GrpsIOMailingListUIDAttribute()
GrpsIOMailingListBaseAttributes()

WritersAttribute()
AuditorsAttribute()

dsl.Required("group_name", "public", "type", "description", "title", "service_uid", "version")
})
dsl.Result(GrpsIOMailingListWithReadonlyAttributes)
Expand Down Expand Up @@ -322,6 +383,72 @@ var _ = dsl.Service("mailing-list", func() {
})
})

dsl.Method("get-grpsio-mailing-list-settings", func() {
dsl.Description("Get GroupsIO mailing list settings (writers and auditors)")
dsl.Security(JWTAuth)
dsl.Payload(func() {
BearerTokenAttribute()
VersionAttribute()
GrpsIOMailingListUIDAttribute()
})
dsl.Result(func() {
dsl.Attribute("mailing_list_settings", GrpsIOMailingListSettings)
ETagAttribute()
dsl.Required("mailing_list_settings")
})
dsl.Error("BadRequest", BadRequestError, "Bad request")
dsl.Error("NotFound", NotFoundError, "Mailing list settings not found")
dsl.Error("InternalServerError", InternalServerError, "Internal server error")
dsl.Error("ServiceUnavailable", ServiceUnavailableError, "Service unavailable")
dsl.HTTP(func() {
dsl.GET("/groupsio/mailing-lists/{uid}/settings")
dsl.Param("version:v")
dsl.Param("uid")
dsl.Header("bearer_token:Authorization")
dsl.Response(dsl.StatusOK, func() {
dsl.Body("mailing_list_settings")
dsl.Header("etag:ETag")
})
dsl.Response("BadRequest", dsl.StatusBadRequest)
dsl.Response("NotFound", dsl.StatusNotFound)
dsl.Response("InternalServerError", dsl.StatusInternalServerError)
dsl.Response("ServiceUnavailable", dsl.StatusServiceUnavailable)
})
})

dsl.Method("update-grpsio-mailing-list-settings", func() {
dsl.Description("Update GroupsIO mailing list settings (writers and auditors)")
dsl.Security(JWTAuth)
dsl.Payload(func() {
BearerTokenAttribute()
VersionAttribute()
IfMatchAttribute()
GrpsIOMailingListUIDAttribute()
WritersAttribute()
AuditorsAttribute()
dsl.Required("version", "uid")
})
dsl.Result(GrpsIOMailingListSettings)
dsl.Error("BadRequest", BadRequestError, "Bad request")
dsl.Error("NotFound", NotFoundError, "Mailing list settings not found")
dsl.Error("Conflict", ConflictError, "Conflict - ETag mismatch")
dsl.Error("InternalServerError", InternalServerError, "Internal server error")
dsl.Error("ServiceUnavailable", ServiceUnavailableError, "Service unavailable")
dsl.HTTP(func() {
dsl.PUT("/groupsio/mailing-lists/{uid}/settings")
dsl.Param("version:v")
dsl.Param("uid")
dsl.Header("bearer_token:Authorization")
dsl.Header("if_match:If-Match")
dsl.Response(dsl.StatusOK)
dsl.Response("BadRequest", dsl.StatusBadRequest)
dsl.Response("NotFound", dsl.StatusNotFound)
dsl.Response("Conflict", dsl.StatusConflict)
dsl.Response("InternalServerError", dsl.StatusInternalServerError)
dsl.Response("ServiceUnavailable", dsl.StatusServiceUnavailable)
})
})

// Member management endpoints
dsl.Method("create-grpsio-mailing-list-member", func() {
dsl.Description("Create a new member for a GroupsIO mailing list")
Expand Down
Loading