-
Notifications
You must be signed in to change notification settings - Fork 245
[full-ci] feat: ocisdev-533 graph #12108
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
Open
2403905
wants to merge
12
commits into
master
Choose a base branch
from
feat/OCISDEV-533-graph
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+841
−148
Open
Changes from 6 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
71d321b
feat: Implemet the vault-storage
2403905 14cdcf3
feat: provide the mfa to webdav and grpc
2403905 c06eb07
feat: refactoring: provide the mfa to webdav and grpc
2403905 d68a36f
mfa collaboration
2403905 81ecc72
fix GetRootDriveChildren and more
2403905 21cd102
fix: send the MFA header in HTTP clients from the collaboration service
jvillafanez ced494f
provide the default storage user vault configuration
2403905 573c62f
update create_home middleware
2403905 82f04d7
Update deployments/examples/ocis_full/vault-storage.yml
2403905 3ddb02d
bump reva
2403905 81399ea
deduplicate the requireMFA middeware on vault routes. fix AppendPlain…
2403905 76bd16b
added the changlog and comments
2403905 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,37 @@ | ||
| services: | ||
| ocis: | ||
| environment: | ||
| OCIS_MFA_ENABLED: true | ||
| NATS_NATS_HOST: 0.0.0.0 | ||
| SETTINGS_GRPC_ADDR: ocis:9191 | ||
| PROXY_CREATE_VAULT_HOME: true | ||
| GRAPH_ENABLE_VAULT_MODE: true | ||
|
|
||
| storage-users-vault: | ||
| image: ${OCIS_DOCKER_IMAGE:-owncloud/ocis}:${OCIS_DOCKER_TAG:-latest} | ||
|
2403905 marked this conversation as resolved.
Outdated
|
||
| networks: | ||
| ocis-net: | ||
| depends_on: | ||
| ocis: | ||
| condition: service_started | ||
| command: ["storage-users", "server"] | ||
| environment: | ||
| OCIS_LOG_LEVEL: debug | ||
| OCIS_GATEWAY_GRPC_ADDR: ocis:9142 | ||
| STORAGE_USERS_ENABLE_VAULT_MODE: true | ||
| STORAGE_USERS_SERVICE_NAME: storage-users-vault | ||
| STORAGE_USERS_GRPC_ADDR: storage-users-vault:9170 | ||
| STORAGE_USERS_HTTP_ADDR: storage-users-vault:9168 | ||
| STORAGE_USERS_DATA_SERVER_URL: http://storage-users-vault:9168/data | ||
| STORAGE_USERS_DEBUG_ADDR: storage-users-vault:9169 | ||
| STORAGE_USERS_OCIS_ROOT: /var/lib/ocis/storage/users-vault | ||
| STORAGE_USERS_EVENTS_CONSUMER_GROUP: vault-dcfs | ||
| MICRO_REGISTRY_ADDRESS: ocis:9233 | ||
| OCIS_EVENTS_ENDPOINT: ocis:9233 | ||
| OCIS_CACHE_STORE_NODES: ocis:9233 | ||
| volumes: | ||
| - ocis-data:/var/lib/ocis | ||
| - ocis-config:/etc/ocis | ||
|
2403905 marked this conversation as resolved.
Outdated
|
||
| logging: | ||
| driver: ${LOG_DRIVER:-local} | ||
| restart: always | ||
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -15,6 +15,7 @@ import ( | |
| rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1" | ||
| providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" | ||
| types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" | ||
| "github.com/owncloud/ocis/v2/ocis-pkg/mfa" | ||
| "github.com/owncloud/ocis/v2/ocis-pkg/tracing" | ||
| "github.com/owncloud/ocis/v2/services/collaboration/pkg/config" | ||
| "github.com/owncloud/ocis/v2/services/collaboration/pkg/middleware" | ||
|
|
@@ -71,6 +72,9 @@ func newHttpRequest(ctx context.Context, wopiContext middleware.WopiContext, met | |
| } else { | ||
| httpReq.Header.Add("X-Access-Token", wopiContext.AccessToken) | ||
| } | ||
| if wopiContext.HasMFA { | ||
| httpReq.Header.Add(mfa.MFAHeader, "true") | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jvillafanez Please use |
||
| } | ||
| return httpReq, nil | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,23 @@ | ||
| package middleware | ||
|
|
||
| import ( | ||
| "net/http" | ||
|
|
||
| "github.com/owncloud/ocis/v2/ocis-pkg/log" | ||
| "github.com/owncloud/ocis/v2/ocis-pkg/mfa" | ||
| ) | ||
|
|
||
| // RequireMFA middleware is used to require the user in context to have MFA satisfied | ||
| func RequireMFA(logger log.Logger) func(next http.Handler) http.Handler { | ||
|
2403905 marked this conversation as resolved.
|
||
| return func(next http.Handler) http.Handler { | ||
| return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||
| if !mfa.Has(r.Context()) { | ||
| l := logger.SubloggerWithRequestID(r.Context()) | ||
| l.Error().Str("path", r.URL.Path).Msg("MFA required but not satisfied") | ||
| mfa.SetRequiredStatus(w) | ||
| return | ||
| } | ||
| next.ServeHTTP(w, r) | ||
| }) | ||
| } | ||
| } | ||
This file contains hidden or 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,27 @@ | ||
| package middleware | ||
|
|
||
| import ( | ||
| "context" | ||
| "net/http" | ||
| ) | ||
|
|
||
| type key int | ||
|
|
||
| const vaultModeKey key = iota | ||
|
|
||
| func SetVaultMode(ctx context.Context, enabled bool) context.Context { | ||
| return context.WithValue(ctx, vaultModeKey, enabled) | ||
| } | ||
|
|
||
| func IsVaultMode(ctx context.Context) bool { | ||
| val, ok := ctx.Value(vaultModeKey).(bool) | ||
| return val && ok | ||
| } | ||
|
|
||
| func VaultModeMiddleware() func(next http.Handler) http.Handler { | ||
| return func(next http.Handler) http.Handler { | ||
| return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { | ||
| next.ServeHTTP(w, r.WithContext(SetVaultMode(r.Context(), true))) | ||
| }) | ||
| } | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.