-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
135 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,10 @@ | ||
Enhancement: Add config for group provider service and sharing SQL driver | ||
Enhancement: Enable group sharing and add config for sharing SQL driver | ||
|
||
https://github.com/owncloud/ocis/pull/1626/files | ||
This PR adds config to support sharing with groups. It also introduces a | ||
breaking change for the CS3APIs definitions since grantees can now refer to both | ||
users as well as groups. Since we store the grantee information in a json file, | ||
`/var/tmp/ocis/storage/shares.json`, its previous version needs to be removed as | ||
we won't be able to unmarshal data corresponding to the previous definitions. | ||
|
||
https://github.com/owncloud/ocis/pull/1626 | ||
https://github.com/cs3org/reva/pull/1453 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
package flagset | ||
|
||
import ( | ||
"github.com/micro/cli/v2" | ||
"github.com/owncloud/ocis/storage/pkg/config" | ||
) | ||
|
||
// RestWithConfig applies REST user/group provider cfg to the flagset | ||
func RestWithConfig(cfg *config.Config) []cli.Flag { | ||
return []cli.Flag{ | ||
&cli.StringFlag{ | ||
Name: "rest-client-id", | ||
Value: "", | ||
Usage: "User/group rest driver Client ID", | ||
EnvVars: []string{"STORAGE_REST_CLIENT_ID"}, | ||
Destination: &cfg.Reva.UserGroupRest.ClientID, | ||
}, | ||
&cli.StringFlag{ | ||
Name: "rest-client-secret", | ||
Value: "", | ||
Usage: "User/group rest driver Client Secret", | ||
EnvVars: []string{"STORAGE_REST_CLIENT_SECRET"}, | ||
Destination: &cfg.Reva.UserGroupRest.ClientSecret, | ||
}, | ||
&cli.StringFlag{ | ||
Name: "rest-redis-address", | ||
Value: "localhost:6379", | ||
Usage: "Address for redis server", | ||
EnvVars: []string{"STORAGE_REST_REDIS_ADDRESS"}, | ||
Destination: &cfg.Reva.UserGroupRest.RedisAddress, | ||
}, | ||
&cli.StringFlag{ | ||
Name: "rest-redis-username", | ||
Value: "", | ||
Usage: "Username for redis server", | ||
EnvVars: []string{"STORAGE_REST_REDIS_USERNAME"}, | ||
Destination: &cfg.Reva.UserGroupRest.RedisUsername, | ||
}, | ||
&cli.StringFlag{ | ||
Name: "rest-redis-password", | ||
Value: "", | ||
Usage: "Password for redis server", | ||
EnvVars: []string{"STORAGE_REST_REDIS_PASSWORD"}, | ||
Destination: &cfg.Reva.UserGroupRest.RedisPassword, | ||
}, | ||
&cli.StringFlag{ | ||
Name: "rest-id-provider", | ||
Value: "", | ||
Usage: "The OIDC Provider", | ||
EnvVars: []string{"STORAGE_REST_ID_PROVIDER"}, | ||
Destination: &cfg.Reva.UserGroupRest.IDProvider, | ||
}, | ||
&cli.StringFlag{ | ||
Name: "rest-api-base-url", | ||
Value: "", | ||
Usage: "Base API Endpoint", | ||
EnvVars: []string{"STORAGE_REST_API_BASE_URL"}, | ||
Destination: &cfg.Reva.UserGroupRest.APIBaseURL, | ||
}, | ||
&cli.StringFlag{ | ||
Name: "rest-oidc-token-endpoint", | ||
Value: "", | ||
Usage: "Endpoint to generate token to access the API", | ||
EnvVars: []string{"STORAGE_REST_OIDC_TOKEN_ENDPOINT"}, | ||
Destination: &cfg.Reva.UserGroupRest.OIDCTokenEndpoint, | ||
}, | ||
&cli.StringFlag{ | ||
Name: "rest-target-api", | ||
Value: "", | ||
Usage: "The target application", | ||
EnvVars: []string{"STORAGE_REST_TARGET_API"}, | ||
Destination: &cfg.Reva.UserGroupRest.TargetAPI, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package flagset | ||
|
||
import ( | ||
"github.com/micro/cli/v2" | ||
"github.com/owncloud/ocis/storage/pkg/config" | ||
) | ||
|
||
// SharingSQLWithConfig applies the Shring SQL driver cfg to the flagset | ||
func SharingSQLWithConfig(cfg *config.Config) []cli.Flag { | ||
return []cli.Flag{ | ||
&cli.StringFlag{ | ||
Name: "user-sql-username", | ||
Value: "", | ||
Usage: "Username to be used to connect to the SQL database", | ||
EnvVars: []string{"STORAGE_SHARING_USER_SQL_USERNAME"}, | ||
Destination: &cfg.Reva.Sharing.UserSQLUsername, | ||
}, | ||
&cli.StringFlag{ | ||
Name: "user-sql-password", | ||
Value: "", | ||
Usage: "Password to be used to connect to the SQL database", | ||
EnvVars: []string{"STORAGE_SHARING_USER_SQL_PASSWORD"}, | ||
Destination: &cfg.Reva.Sharing.UserSQLPassword, | ||
}, | ||
&cli.StringFlag{ | ||
Name: "user-sql-host", | ||
Value: "", | ||
Usage: "Hostname of the SQL database", | ||
EnvVars: []string{"STORAGE_SHARING_USER_SQL_HOST"}, | ||
Destination: &cfg.Reva.Sharing.UserSQLHost, | ||
}, | ||
&cli.IntFlag{ | ||
Name: "user-sql-port", | ||
Value: 1433, | ||
Usage: "The port on which the SQL database is exposed", | ||
EnvVars: []string{"STORAGE_SHARING_USER_SQL_PORT"}, | ||
Destination: &cfg.Reva.Sharing.UserSQLPort, | ||
}, | ||
&cli.StringFlag{ | ||
Name: "user-sql-name", | ||
Value: "", | ||
Usage: "Name of the SQL database", | ||
EnvVars: []string{"STORAGE_SHARING_USER_SQL_Name"}, | ||
Destination: &cfg.Reva.Sharing.UserSQLName, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters