-
Notifications
You must be signed in to change notification settings - Fork 176
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
Backport to stable 5.0 of https://github.com/owncloud/ocis/pull/8756 #8781
Backport to stable 5.0 of https://github.com/owncloud/ocis/pull/8756 #8781
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
Signed-off-by: Christian Richter <[email protected]>
Signed-off-by: Christian Richter <[email protected]>
Signed-off-by: Christian Richter <[email protected]>
1b63909
to
f4b673a
Compare
Quality Gate passedIssues Measures |
|
||
type API struct { | ||
ShowUserEmailInResults bool `yaml:"show_email_in_results" env:"OCIS_SHOW_USER_EMAIL_IN_RESULTS" desc:"Mask user email addresses in responses." introductionVersion:"5.1"` | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be 5.0.1, now that we backported it? (would need to be changed in master as well I guess)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thing is, it was/will be introduced in 5.1 not 5.0 it is a backport to 5.0 that does not follow the behavior it will have in 5.1 (see defaultconfig.go) so I am unsure what to actually put in there :) Let's decide tomorrow in/after the daily.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are sneaking in a new environment variable and default it to true for the v5.0 branch. For 5.1 we will change the default to false
which will be a breaking change. It will be announced in the 5.1 release notes.
The future behavior can inofficially already be used in 5.0.1 by explicitly setting OCIS_SHOW_USER_EMAIL_IN_RESULTS=false
. Yeah ... we're lying to save ourselves a breaking change ;-)
Setting introductionVersion:"5.0.1"
only leads to more work. Maybe we can just add (EXPERIMENTAL)
to the description, similar to how the linux kernel does it.
Co-authored-by: Jörn Friedrich Dreyer <[email protected]>
will add experimental to description and introduce in 5.1, not 5.0.1
ci was green, but github did not pick up the notification ... merged manually |
Backport to stable 5.0 of #8756
|
|
Backport to stable 5.0 of #8756
Backport to stable 5.0 of #8756
Backport to stable 5.0 of #8756
@@ -4,3 +4,7 @@ package config | |||
type TokenManager struct { | |||
JWTSecret string `yaml:"jwt_secret" env:"OCIS_JWT_SECRET;OCS_JWT_SECRET" desc:"The secret to mint and validate jwt tokens." introductionVersion:"pre5.0"` | |||
} | |||
|
|||
type API struct { | |||
ShowUserEmailInResults bool `yaml:"show_email_in_results" env:"OCIS_SHOW_USER_EMAIL_IN_RESULTS" desc:"Mask user email addresses in responses. (EXPERIMENTAL)" introductionVersion:"5.1"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some stupid questions from my side:
-
isn't this supposed to go into the fronted service where the real ocs api lives? The ocs service is only about the signing-key endpoint (look at the proxy default routes).
-
but even then, isn't there a wire missing:
diff --git a/services/frontend/pkg/revaconfig/config.go b/services/frontend/pkg/revaconfig/config.go
index 0b38abaab5..5db9460c30 100644
--- a/services/frontend/pkg/revaconfig/config.go
+++ b/services/frontend/pkg/revaconfig/config.go
@@ -339,7 +339,8 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string
"productversion": version.GetString(),
},
},
- "include_ocm_sharees": cfg.OCS.IncludeOCMSharees,
+ "include_ocm_sharees": cfg.OCS.IncludeOCMSharees,
+ "show_email_in_results": cfg.OCS.ShowEmailInResults,
},
},
},
Currently this defaults to never show emails in results because bools default to false. At least I couldn't get emails to show up in the search
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default is true, see defaultconfig.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But I don't see the emails when searching for a user.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes it work for me:
diff --git a/deployments/examples/ocis_traefik/docker-compose.yml b/deployments/examples/ocis_traefik/docker-compose.yml
index 10ef857021..d279bfafbb 100644
--- a/deployments/examples/ocis_traefik/docker-compose.yml
+++ b/deployments/examples/ocis_traefik/docker-compose.yml
@@ -46,7 +46,7 @@ services:
restart: always
ocis:
- image: owncloud/ocis:${OCIS_DOCKER_TAG:-latest}
+ image: owncloud/ocis:dev
networks:
ocis-net:
entrypoint:
diff --git a/services/frontend/pkg/config/config.go b/services/frontend/pkg/config/config.go
index 9cae9ab91a..c0dfdafc28 100644
--- a/services/frontend/pkg/config/config.go
+++ b/services/frontend/pkg/config/config.go
@@ -145,6 +145,7 @@ type OCS struct {
PublicShareMustHavePassword bool `yaml:"public_sharing_share_must_have_password" env:"OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD;FRONTEND_OCS_PUBLIC_SHARE_MUST_HAVE_PASSWORD" desc:"Set this to true if you want to enforce passwords on all public shares." introductionVersion:"5.0"`
WriteablePublicShareMustHavePassword bool `yaml:"public_sharing_writeableshare_must_have_password" env:"OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD;FRONTEND_OCS_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD" desc:"Set this to true if you want to enforce passwords on Uploader, Editor or Contributor shares." introductionVersion:"5.0"`
IncludeOCMSharees bool `yaml:"include_ocm_sharees" env:"FRONTEND_OCS_INCLUDE_OCM_SHAREES" desc:"Include OCM sharees when listing sharees." introductionVersion:"5.0"`
+ ShowUserEmailInResults bool `yaml:"show_user_email_in_results" env:"OCIS_SHOW_USER_EMAIL_IN_RESULTS" desc:"Mask user email addresses in responses. (EXPERIMENTAL)" introductionVersion:"5.1"`
}
type CacheWarmupDrivers struct {
diff --git a/services/frontend/pkg/config/defaults/defaultconfig.go b/services/frontend/pkg/config/defaults/defaultconfig.go
index 5a9b81c9ac..ae99b4aadd 100644
--- a/services/frontend/pkg/config/defaults/defaultconfig.go
+++ b/services/frontend/pkg/config/defaults/defaultconfig.go
@@ -116,6 +116,7 @@ func DefaultConfig() *config.Config {
ListOCMShares: true,
PublicShareMustHavePassword: true,
IncludeOCMSharees: false,
+ ShowUserEmailInResults: true,
},
Middleware: config.Middleware{
Auth: config.Auth{
diff --git a/services/frontend/pkg/revaconfig/config.go b/services/frontend/pkg/revaconfig/config.go
index 0b38abaab5..9226737782 100644
--- a/services/frontend/pkg/revaconfig/config.go
+++ b/services/frontend/pkg/revaconfig/config.go
@@ -339,7 +339,8 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string
"productversion": version.GetString(),
},
},
- "include_ocm_sharees": cfg.OCS.IncludeOCMSharees,
+ "include_ocm_sharees": cfg.OCS.IncludeOCMSharees,
+ "show_email_in_results": cfg.OCS.ShowUserEmailInResults,
},
},
},
diff --git a/services/ocs/pkg/config/config.go b/services/ocs/pkg/config/config.go
index ed7a0ab96e..4097ff4ef6 100644
--- a/services/ocs/pkg/config/config.go
+++ b/services/ocs/pkg/config/config.go
@@ -19,8 +19,7 @@ type Config struct {
Debug Debug `yaml:"debug"`
HTTP HTTP `yaml:"http"`
- API API `yaml:"api"`
-
+
GRPCClientTLS *shared.GRPCClientTLS `yaml:"grpc_client_tls"`
GrpcClient client.Client `yaml:"-"`
diff --git a/services/ocs/pkg/config/defaults/defaultconfig.go b/services/ocs/pkg/config/defaults/defaultconfig.go
index a665c78b2a..6a9ebec588 100644
--- a/services/ocs/pkg/config/defaults/defaultconfig.go
+++ b/services/ocs/pkg/config/defaults/defaultconfig.go
@@ -44,9 +44,6 @@ func DefaultConfig() *config.Config {
Nodes: []string{"127.0.0.1:9233"},
TTL: time.Hour * 12,
},
- API: config.API{
- ShowUserEmailInResults: true,
- },
}
}
diff --git a/services/ocs/pkg/config/reva.go b/services/ocs/pkg/config/reva.go
index 05e8d8c8d7..8413904dab 100644
--- a/services/ocs/pkg/config/reva.go
+++ b/services/ocs/pkg/config/reva.go
@@ -4,7 +4,3 @@ package config
type TokenManager struct {
JWTSecret string `yaml:"jwt_secret" env:"OCIS_JWT_SECRET;OCS_JWT_SECRET" desc:"The secret to mint and validate jwt tokens." introductionVersion:"pre5.0"`
}
-
-type API struct {
- ShowUserEmailInResults bool `yaml:"show_email_in_results" env:"OCIS_SHOW_USER_EMAIL_IN_RESULTS" desc:"Mask user email addresses in responses. (EXPERIMENTAL)" introductionVersion:"5.1"`
-}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be the same like my changes 12c785e
No description provided.