Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup unused configs in OCM HTTP service #3675

Merged
merged 2 commits into from
Feb 22, 2023
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
3 changes: 3 additions & 0 deletions changelog/unreleased/ocm-config-cleanup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Enhancement: Cleanup unused configs in OCM HTTP service

https://github.com/cs3org/reva/pull/3675
9 changes: 1 addition & 8 deletions internal/http/services/ocmd/invites.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,11 @@ import (
"github.com/cs3org/reva/internal/http/services/reqres"
"github.com/cs3org/reva/pkg/appctx"
"github.com/cs3org/reva/pkg/rgrpc/todo/pool"
"github.com/cs3org/reva/pkg/smtpclient"
"github.com/cs3org/reva/pkg/utils"
)

type invitesHandler struct {
smtpCredentials *smtpclient.SMTPCredentials
gatewayClient gateway.GatewayAPIClient
meshDirectoryURL string
gatewayClient gateway.GatewayAPIClient
}

func (h *invitesHandler) init(c *config) error {
Expand All @@ -49,10 +46,6 @@ func (h *invitesHandler) init(c *config) error {
if err != nil {
return err
}
if c.SMTPCredentials != nil {
h.smtpCredentials = smtpclient.NewSMTPCredentials(c.SMTPCredentials)
}
h.meshDirectoryURL = c.MeshDirectoryURL
return nil
}

Expand Down
12 changes: 4 additions & 8 deletions internal/http/services/ocmd/ocm.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"github.com/cs3org/reva/pkg/appctx"
"github.com/cs3org/reva/pkg/rhttp/global"
"github.com/cs3org/reva/pkg/sharedconf"
"github.com/cs3org/reva/pkg/smtpclient"
"github.com/go-chi/chi/v5"
"github.com/mitchellh/mapstructure"
"github.com/rs/zerolog"
Expand All @@ -35,13 +34,10 @@ func init() {
}

type config struct {
SMTPCredentials *smtpclient.SMTPCredentials `mapstructure:"smtp_credentials"`
Prefix string `mapstructure:"prefix"`
Host string `mapstructure:"host"`
GatewaySvc string `mapstructure:"gatewaysvc"`
MeshDirectoryURL string `mapstructure:"mesh_directory_url"`
Config configData `mapstructure:"config"`
ExposeRecipientDisplayName bool `mapstructure:"expose_recipient_display_name"`
Prefix string `mapstructure:"prefix"`
GatewaySvc string `mapstructure:"gatewaysvc"`
Config configData `mapstructure:"config"`
ExposeRecipientDisplayName bool `mapstructure:"expose_recipient_display_name"`
}

func (c *config) init() {
Expand Down