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

WIP: tracing + refactor + gateway service. #165

Merged
merged 34 commits into from
Aug 14, 2019
Merged

WIP: tracing + refactor + gateway service. #165

merged 34 commits into from
Aug 14, 2019

Conversation

labkode
Copy link
Member

@labkode labkode commented Jul 30, 2019

No description provided.

@labkode labkode changed the title WIP: tracing + reactor + gateway service WIP: tracing + refactor + gateway service Jul 30, 2019
cmd/revad/svcs/httpsvcs/handlers/auth/auth.go Outdated Show resolved Hide resolved
cmd/revad/httpserver/httpserver.go Outdated Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Jul 30, 2019

Codecov Report

Merging #165 into master will not change coverage.
The diff coverage is 92.3%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #165   +/-   ##
=====================================
  Coverage      75%    75%           
=====================================
  Files           2      2           
  Lines          40     40           
=====================================
  Hits           30     30           
  Misses          5      5           
  Partials        5      5
Impacted Files Coverage Δ
pkg/token/manager/demo/demo.go 70.58% <92.3%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5bdbb77...fff604e. Read the comment docs.

pkg/share/manager/memory/memory.go Show resolved Hide resolved
pkg/share/manager/memory/memory.go Show resolved Hide resolved
pkg/share/manager/memory/memory.go Outdated Show resolved Hide resolved
pkg/share/manager/memory/memory.go Outdated Show resolved Hide resolved
Copy link
Contributor

@butonic butonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! get it in!

cmd/revad/svcs/httpsvcs/ocdavsvc/ocdavsvc.go Show resolved Hide resolved
cmd/reva/share.go Outdated Show resolved Hide resolved
cmd/reva/share.go Outdated Show resolved Hide resolved
cmd/reva/share.go Outdated Show resolved Hide resolved
Copy link
Contributor

@butonic butonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried rebasing some versioning work and ran into problems

cmd/revad/svcs/httpsvcs/ocdavsvc/ocdavsvc.go Show resolved Hide resolved
pkg/share/manager/loader/loader.go Show resolved Hide resolved
Copy link
Contributor

@butonic butonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The gateway runs on 10000, right? or would this work without a gateway?

cmd/revad/revad.toml Show resolved Hide resolved
cmd/revad/revad.toml Show resolved Hide resolved
cmd/revad/revad.toml Show resolved Hide resolved
@butonic
Copy link
Contributor

butonic commented Aug 13, 2019

ok I got that you use reva to configure the gateway...

Copy link
Contributor

@butonic butonic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, cool I have this working for basic auth using this gateway config:

# This config file will start a reva gateway that:
# - handles incoming HTTP requests
# - forwards GRPC requests to the backend

[core]
log_file = "stderr"
log_mode = "dev"
max_cpus = "100%"
#tracing_enabled = true

[log]
level = "debug"
mode = "console"

# What http services should be started?

[http]
network = "tcp"
address = "0.0.0.0:9998"
enabled_services = ["appregistrysvc", "ocdavsvc", "ocssvc", "datasvc", "preferencessvc", "prometheussvc"]
enabled_middlewares = ["cors", "auth"]

# HTTP middlewares

[http.middlewares.auth]
# directly talk to the backend for authentication to save a grpc request
gatewaysvc = "0.0.0.0:9999"
credential_strategy = "basic"
token_strategy = "header"
token_writer = "header"
token_manager = "jwt"
skip_methods = ["/status.php", "/metrics"]

[http.middlewares.auth.token_managers.jwt]
secret = "Uv38ByGCZU8WP18PmmIdcpVmx00QA3xN"

# HTTP services

[http.services.appregistrysvc]
prefix = "appregistry"
gatewaysvc = "localhost:10000"

[http.services.preferencessvc]
prefix = "preferences"
gatewaysvc = "localhost:10000"

[http.services.iframeuisvc]
prefix = "iframe"

[http.services.webuisvc]
prefix = "ui"

[http.services.ocdavsvc]
prefix = ""
gatewaysvc = "localhost:10000"
chunk_folder = "/var/tmp/owncloud/chunks"
enable_cors = true

[http.services.ocssvc]
prefix = "ocs"
gatewaysvc = "localhost:10000"
# the list of share recipients is taken fro the user.json file
user_manager = "json"

[http.services.ocssvc.user_managers.json]
users = "/data/users.json"

[http.services.ocssvc.config]
version = "1.8"
website = "nexus"
host = "https://localhost:9998"
contact = "admin@localhost"
ssl = "true"
[http.services.ocssvc.capabilities.capabilities.core]
poll_interval = 60
webdav_root = "remote.php/webdav"
[http.services.ocssvc.capabilities.capabilities.core.status]
installed = true
maintenance = false
needsDbUpgrade = false
version = "10.0.9.5"
versionstring = "10.0.9"
edition = "community"
productname = "reva"
hostname = ""
[http.services.ocssvc.capabilities.capabilities.checksums]
supported_types = ["SHA256"]
preferred_upload_type = "SHA256"
[http.services.ocssvc.capabilities.capabilities.files]
private_links = true
bigfilechunking = true
blacklisted_files = ["foo"]
undelete = true
versioning = true
[http.services.ocssvc.capabilities.capabilities.dav]
chunking = "1.0"
[http.services.ocssvc.capabilities.capabilities.files_sharing]
api_enabled = true
resharing = true
group_sharing = true
auto_accept_share = true
share_with_group_members_only = true
share_with_membership_groups_only = true
default_permissions = 22
search_min_length = 3
[http.services.ocssvc.capabilities.capabilities.files_sharing.public]
enabled = true
send_mail = true
social_share = true
upload = true
multiple = true
supports_upload_only = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.public.password]
enforced = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.public.password.enforced_for]
read_only = true
read_write = true
upload_only = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.public.expire_date]
enabled = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.user]
send_mail = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.user_enumeration]
enabled = true
group_members_only = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.federation]
outgoing = true
incoming = true
[http.services.ocssvc.capabilities.capabilities.notifications]
endpoints = ["list", "get", "delete"]
[http.services.ocssvc.capabilities.version]
edition = "nexus"
major = 10
minor = 0
micro = 11
string = "10.0.11"

[http.services.datasvc]
driver = "local"
prefix = "data"
temp_folder = "/var/tmp/"

[http.services.datasvc.drivers.local]
root = "/data"


# also start the grpc gateway for other cs3 services so we have one frontend process

[grpc]
network = "tcp"
address = "0.0.0.0:10000"
enabled_services = ["gatewaysvc"]

[grpc.services.gatewaysvc]
storageregistrysvc = "localhost:9999"
authsvc = "localhost:9999"
usershareprovidersvc = "localhost:9999"
appregistrysvc = "localhost:9999"
preferencessvc = "localhost:9999"

and this backend config

# This config file will start a reva grpc service backend that:
# - stores files in the local storage
# - reads users from users.json
# - uses basic authentication to authenticate requests

[core]
log_file = "stderr"
log_mode = "dev"
max_cpus = "2"
tracing_enabled = true
disable_http = true

[log]
level = "debug"
mode = "console"

# What grpc services  should be started?

[grpc]
network = "tcp"
address = "0.0.0.0:9999"
enabled_services = ["storageprovidersvc", "authsvc", "storageregistrysvc", "appregistrysvc", "appprovidersvc", "preferencessvc", "usershareprovidersvc"]
enabled_interceptors = ["auth"]

# Order and configuration of grpc interceptors 

# GRPC interceptors

[grpc.interceptors.auth]
# keys for grpc metadata are always lowercase, so interceptors headers need to use lowercase.
token_manager = "jwt"
# GenerateAccessToken contains the credentials in the payload. Skip auth, otherwise services cannot obtain a token.
skip_methods = ["/cs3.authv0alpha.AuthService/GenerateAccessToken", "/cs3.authv0alpha.AuthService/WhoAmI"]

[grpc.interceptors.auth.token_managers.jwt]
secret = "Uv38ByGCZU8WP18PmmIdcpVmx00QA3xN"

# GRPC services

## The authentication service

[grpc.services.authsvc]
token_manager = "jwt"
# users are authorized by checking their password matches the one in the users.json file
auth_manager = "json"
# user info is read from the user.json file
user_manager = "json"

[grpc.services.authsvc.auth_managers.json]
users = "/data/users.json"

[grpc.services.authsvc.user_managers.json]
users = "/data/users.json"

[grpc.services.authsvc.token_managers.jwt]
secret = "Uv38ByGCZU8WP18PmmIdcpVmx00QA3xN"

## The storage registry service

[grpc.services.storageregistrysvc]
driver = "static"

[grpc.services.storageregistrysvc.drivers.static.rules]
"/" = "localhost:9999"
"123e4567-e89b-12d3-a456-426655440000" = "localhost:9999"

## The storage provider service

[grpc.services.appregistrysvc]
driver = "static"

[grpc.services.appregistrysvc.static.rules]
".txt" = "localhost:9999"
"text/plain" = "localhost:9999"

[grpc.services.appprovidersvc]
driver = "demo"

[grpc.services.appprovidersvc.demo]
iframe_ui_provider = "http://localhost:9998/iframeuisvc"

[grpc.services.storageprovidersvc]
driver = "local"
mount_path = "/"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
data_server_url = "http://127.0.0.1:9998/data"

[grpc.services.storageprovidersvc.available_checksums]
md5   = 100
unset = 1000

[grpc.services.storageprovidersvc.drivers.local]
root = "/data"



## The user share provider service

[grpc.services.usershareprovidersvc]
driver = "memory"

@labkode
Copy link
Member Author

labkode commented Aug 13, 2019

Ok, cool I have this working for basic auth using this gateway config:

# This config file will start a reva gateway that:
# - handles incoming HTTP requests
# - forwards GRPC requests to the backend

[core]
log_file = "stderr"
log_mode = "dev"
max_cpus = "100%"
#tracing_enabled = true

[log]
level = "debug"
mode = "console"

# What http services should be started?

[http]
network = "tcp"
address = "0.0.0.0:9998"
enabled_services = ["appregistrysvc", "ocdavsvc", "ocssvc", "datasvc", "preferencessvc", "prometheussvc"]
enabled_middlewares = ["cors", "auth"]

# HTTP middlewares

[http.middlewares.auth]
# directly talk to the backend for authentication to save a grpc request
gatewaysvc = "0.0.0.0:9999"
credential_strategy = "basic"
token_strategy = "header"
token_writer = "header"
token_manager = "jwt"
skip_methods = ["/status.php", "/metrics"]

[http.middlewares.auth.token_managers.jwt]
secret = "Uv38ByGCZU8WP18PmmIdcpVmx00QA3xN"

# HTTP services

[http.services.appregistrysvc]
prefix = "appregistry"
gatewaysvc = "localhost:10000"

[http.services.preferencessvc]
prefix = "preferences"
gatewaysvc = "localhost:10000"

[http.services.iframeuisvc]
prefix = "iframe"

[http.services.webuisvc]
prefix = "ui"

[http.services.ocdavsvc]
prefix = ""
gatewaysvc = "localhost:10000"
chunk_folder = "/var/tmp/owncloud/chunks"
enable_cors = true

[http.services.ocssvc]
prefix = "ocs"
gatewaysvc = "localhost:10000"
# the list of share recipients is taken fro the user.json file
user_manager = "json"

[http.services.ocssvc.user_managers.json]
users = "/data/users.json"

[http.services.ocssvc.config]
version = "1.8"
website = "nexus"
host = "https://localhost:9998"
contact = "admin@localhost"
ssl = "true"
[http.services.ocssvc.capabilities.capabilities.core]
poll_interval = 60
webdav_root = "remote.php/webdav"
[http.services.ocssvc.capabilities.capabilities.core.status]
installed = true
maintenance = false
needsDbUpgrade = false
version = "10.0.9.5"
versionstring = "10.0.9"
edition = "community"
productname = "reva"
hostname = ""
[http.services.ocssvc.capabilities.capabilities.checksums]
supported_types = ["SHA256"]
preferred_upload_type = "SHA256"
[http.services.ocssvc.capabilities.capabilities.files]
private_links = true
bigfilechunking = true
blacklisted_files = ["foo"]
undelete = true
versioning = true
[http.services.ocssvc.capabilities.capabilities.dav]
chunking = "1.0"
[http.services.ocssvc.capabilities.capabilities.files_sharing]
api_enabled = true
resharing = true
group_sharing = true
auto_accept_share = true
share_with_group_members_only = true
share_with_membership_groups_only = true
default_permissions = 22
search_min_length = 3
[http.services.ocssvc.capabilities.capabilities.files_sharing.public]
enabled = true
send_mail = true
social_share = true
upload = true
multiple = true
supports_upload_only = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.public.password]
enforced = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.public.password.enforced_for]
read_only = true
read_write = true
upload_only = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.public.expire_date]
enabled = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.user]
send_mail = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.user_enumeration]
enabled = true
group_members_only = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.federation]
outgoing = true
incoming = true
[http.services.ocssvc.capabilities.capabilities.notifications]
endpoints = ["list", "get", "delete"]
[http.services.ocssvc.capabilities.version]
edition = "nexus"
major = 10
minor = 0
micro = 11
string = "10.0.11"

[http.services.datasvc]
driver = "local"
prefix = "data"
temp_folder = "/var/tmp/"

[http.services.datasvc.drivers.local]
root = "/data"


# also start the grpc gateway for other cs3 services so we have one frontend process

[grpc]
network = "tcp"
address = "0.0.0.0:10000"
enabled_services = ["gatewaysvc"]

[grpc.services.gatewaysvc]
storageregistrysvc = "localhost:9999"
authsvc = "localhost:9999"
usershareprovidersvc = "localhost:9999"
appregistrysvc = "localhost:9999"
preferencessvc = "localhost:9999"

and this backend config

# This config file will start a reva grpc service backend that:
# - stores files in the local storage
# - reads users from users.json
# - uses basic authentication to authenticate requests

[core]
log_file = "stderr"
log_mode = "dev"
max_cpus = "2"
tracing_enabled = true
disable_http = true

[log]
level = "debug"
mode = "console"

# What grpc services  should be started?

[grpc]
network = "tcp"
address = "0.0.0.0:9999"
enabled_services = ["storageprovidersvc", "authsvc", "storageregistrysvc", "appregistrysvc", "appprovidersvc", "preferencessvc", "usershareprovidersvc"]
enabled_interceptors = ["auth"]

# Order and configuration of grpc interceptors 

# GRPC interceptors

[grpc.interceptors.auth]
# keys for grpc metadata are always lowercase, so interceptors headers need to use lowercase.
token_manager = "jwt"
# GenerateAccessToken contains the credentials in the payload. Skip auth, otherwise services cannot obtain a token.
skip_methods = ["/cs3.authv0alpha.AuthService/GenerateAccessToken", "/cs3.authv0alpha.AuthService/WhoAmI"]

[grpc.interceptors.auth.token_managers.jwt]
secret = "Uv38ByGCZU8WP18PmmIdcpVmx00QA3xN"

# GRPC services

## The authentication service

[grpc.services.authsvc]
token_manager = "jwt"
# users are authorized by checking their password matches the one in the users.json file
auth_manager = "json"
# user info is read from the user.json file
user_manager = "json"

[grpc.services.authsvc.auth_managers.json]
users = "/data/users.json"

[grpc.services.authsvc.user_managers.json]
users = "/data/users.json"

[grpc.services.authsvc.token_managers.jwt]
secret = "Uv38ByGCZU8WP18PmmIdcpVmx00QA3xN"

## The storage registry service

[grpc.services.storageregistrysvc]
driver = "static"

[grpc.services.storageregistrysvc.drivers.static.rules]
"/" = "localhost:9999"
"123e4567-e89b-12d3-a456-426655440000" = "localhost:9999"

## The storage provider service

[grpc.services.appregistrysvc]
driver = "static"

[grpc.services.appregistrysvc.static.rules]
".txt" = "localhost:9999"
"text/plain" = "localhost:9999"

[grpc.services.appprovidersvc]
driver = "demo"

[grpc.services.appprovidersvc.demo]
iframe_ui_provider = "http://localhost:9998/iframeuisvc"

[grpc.services.storageprovidersvc]
driver = "local"
mount_path = "/"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
data_server_url = "http://127.0.0.1:9998/data"

[grpc.services.storageprovidersvc.available_checksums]
md5   = 100
unset = 1000

[grpc.services.storageprovidersvc.drivers.local]
root = "/data"



## The user share provider service

[grpc.services.usershareprovidersvc]
driver = "memory"

The basic config files revad.toml and gateway.toml should give you that already, minus the owncloud specific config, does it work with Phoenix?

@butonic
Copy link
Contributor

butonic commented Aug 13, 2019

and oidc works as well with this gateway:

# This config file will start a reva gateway that:
# - handles incoming HTTP requests
# - forwards GRPC requests to the backend

[core]
log_file = "stderr"
log_mode = "dev"
max_cpus = "100%"
#tracing_enabled = true

[log]
level = "debug"
mode = "console"

# What http services should be started?

[http]
network = "tcp"
address = "0.0.0.0:9998"
enabled_services = [
    "appregistrysvc",
    "ocdavsvc",
    "ocssvc",
    "datasvc",
    "preferencessvc",
    "prometheussvc",
    "oidcprovider",
    "wellknown"
]
enabled_middlewares = ["cors", "auth"]

# HTTP middlewares

[http.middlewares.auth]
priority = 200
# directly talk to the backend for authentication to save a grpc request
gatewaysvc = "0.0.0.0:9999"
credential_strategy = "oidc"
token_strategy = "header"
token_writer = "header"
token_manager = "jwt"
skip_methods = [
    "/status.php",
    "/oauth2",
    "/oauth2/auth", 
    "/oauth2/token", 
    "/oauth2/introspect",
    "/oauth2/userinfo", 
    "/oauth2/sessions", 
    "/.well-known/openid-configuration",
    "/metrics"
]

[http.middlewares.auth.token_managers.jwt]
secret = "Uv38ByGCZU8WP18PmmIdcpVmx00QA3xN"

[http.middlewares.cors]
priority = 100
allowed_origins = ["*"]
allow_credentials = true
allowed_methods = ["OPTIONS", "GET", "PUT", "POST", "DELETE", "MKCOL", "PROPFIND", "PROPPATCH", "MOVE", "COPY", "REPORT", "SEARCH"]
allowed_headers = ["Origin", "Accept", "Content-Type", "X-Requested-With", "Authorization", "Ocs-Apirequest"]
options_passthrough = true

# HTTP services

[http.services.appregistrysvc]
prefix = "appregistry"
gatewaysvc = "localhost:10000"

[http.services.preferencessvc]
prefix = "preferences"
gatewaysvc = "localhost:10000"

[http.services.iframeuisvc]
prefix = "iframe"

[http.services.webuisvc]
prefix = "ui"

[http.services.ocdavsvc]
prefix = ""
gatewaysvc = "localhost:10000"
chunk_folder = "/var/tmp/owncloud/chunks"

[http.services.ocssvc]
prefix = "ocs"
gatewaysvc = "localhost:10000"
# the list of share recipients is taken fro the user.json file
user_manager = "json"

[http.services.ocssvc.user_managers.json]
users = "/data/users.json"

[http.services.ocssvc.config]
version = "1.8"
website = "nexus"
host = "https://localhost:9998"
contact = "admin@localhost"
ssl = "true"
[http.services.ocssvc.capabilities.capabilities.core]
poll_interval = 60
webdav_root = "remote.php/webdav"
[http.services.ocssvc.capabilities.capabilities.core.status]
installed = true
maintenance = false
needsDbUpgrade = false
version = "10.0.9.5"
versionstring = "10.0.9"
edition = "community"
productname = "reva"
hostname = ""
[http.services.ocssvc.capabilities.capabilities.checksums]
supported_types = ["SHA256"]
preferred_upload_type = "SHA256"
[http.services.ocssvc.capabilities.capabilities.files]
private_links = true
bigfilechunking = true
blacklisted_files = ["foo"]
undelete = true
versioning = true
[http.services.ocssvc.capabilities.capabilities.dav]
chunking = "1.0"
[http.services.ocssvc.capabilities.capabilities.files_sharing]
api_enabled = true
resharing = true
group_sharing = true
auto_accept_share = true
share_with_group_members_only = true
share_with_membership_groups_only = true
default_permissions = 22
search_min_length = 3
[http.services.ocssvc.capabilities.capabilities.files_sharing.public]
enabled = true
send_mail = true
social_share = true
upload = true
multiple = true
supports_upload_only = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.public.password]
enforced = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.public.password.enforced_for]
read_only = true
read_write = true
upload_only = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.public.expire_date]
enabled = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.user]
send_mail = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.user_enumeration]
enabled = true
group_members_only = true
[http.services.ocssvc.capabilities.capabilities.files_sharing.federation]
outgoing = true
incoming = true
[http.services.ocssvc.capabilities.capabilities.notifications]
endpoints = ["list", "get", "delete"]
[http.services.ocssvc.capabilities.version]
edition = "nexus"
major = 10
minor = 0
micro = 11
string = "10.0.11"

[http.services.datasvc]
driver = "local"
prefix = "data"
temp_folder = "/var/tmp/"

[http.services.datasvc.drivers.local]
root = "/data"

[http.services.oidcprovider]
prefix = "oauth2"

[http.services.wellknown]
prefix = ".well-known"

# also start the grpc gateway for other cs3 services so we have one frontend process

[grpc]
network = "tcp"
address = "0.0.0.0:10000"
enabled_services = ["gatewaysvc"]

[grpc.services.gatewaysvc]
storageregistrysvc = "localhost:9999"
authsvc = "localhost:9999"
usershareprovidersvc = "localhost:9999"
appregistrysvc = "localhost:9999"
preferencessvc = "localhost:9999"

this backend:

# This config file will start a reva grpc service backend that:
# - stores files in the local storage
# - reads users from users.json
# - uses basic authentication to authenticate requests

[core]
log_file = "stderr"
log_mode = "dev"
max_cpus = "2"
tracing_enabled = true
disable_http = true

[log]
level = "debug"
mode = "console"

# What grpc services  should be started?

[grpc]
network = "tcp"
address = "0.0.0.0:9999"
enabled_services = ["storageprovidersvc", "authsvc", "storageregistrysvc", "appregistrysvc", "appprovidersvc", "preferencessvc", "usershareprovidersvc"]
enabled_interceptors = ["auth"]

# Order and configuration of grpc interceptors 

# GRPC interceptors

[grpc.interceptors.auth]
# keys for grpc metadata are always lowercase, so interceptors headers need to use lowercase.
token_manager = "jwt"
# GenerateAccessToken contains the credentials in the payload. Skip auth, otherwise services cannot obtain a token.
skip_methods = ["/cs3.authv0alpha.AuthService/GenerateAccessToken", "/cs3.authv0alpha.AuthService/WhoAmI"]

[grpc.interceptors.auth.token_managers.jwt]
secret = "Uv38ByGCZU8WP18PmmIdcpVmx00QA3xN"


# GRPC services

## The authentication service

[grpc.services.authsvc]
token_manager = "jwt"
# users are authorized by checking their password matches the one in the users.json file
auth_manager = "oidc"
# user info is read from the user.json file
user_manager = "oidc"

[grpc.services.authsvc.auth_managers.oidc]
provider = "http://localhost:9998"
insecure = true
# the client credentials for the token introspection beckchannel
client_id = "phoenix"
client_secret = "foobar"

[grpc.services.authsvc.token_managers.jwt]
secret = "Uv38ByGCZU8WP18PmmIdcpVmx00QA3xN"

## The storage registry service

[grpc.services.storageregistrysvc]
driver = "static"

[grpc.services.storageregistrysvc.drivers.static.rules]
"/" = "localhost:9999"
"123e4567-e89b-12d3-a456-426655440000" = "localhost:9999"

## The storage provider service

[grpc.services.appregistrysvc]
driver = "static"

[grpc.services.appregistrysvc.static.rules]
".txt" = "localhost:9999"
"text/plain" = "localhost:9999"

[grpc.services.appprovidersvc]
driver = "demo"

[grpc.services.appprovidersvc.demo]
iframe_ui_provider = "http://localhost:9998/iframeuisvc"

[grpc.services.storageprovidersvc]
driver = "local"
mount_path = "/"
mount_id = "123e4567-e89b-12d3-a456-426655440000"
data_server_url = "http://127.0.0.1:9998/data"

[grpc.services.storageprovidersvc.available_checksums]
md5   = 100
unset = 1000


[grpc.services.storageprovidersvc.drivers.local]
root = "/data"



## The user share provider service

[grpc.services.usershareprovidersvc]
driver = "memory"

this config.json for phoenix:

{
  "server" : "http://localhost:9998",
  "theme": "owncloud",
  "version": "0.1.0",
  "openIdConnect": {
    "authority": "http://localhost:9998",
    "metadataUrl": "http://localhost:9998/.well-known/openid-configuration",
    "client_id": "phoenix",
    "client_secret": "foobar",
    "response_type": "code",
    "scope": "openid profile email",
    "extraQueryParams": {
      "claims": "{\"userinfo\":{\"name\":{\"essential\":true},\"preferred_username\":{\"essential\":true},\"email\":{\"essential\":true},\"email_verified\":{\"essential\":true},\"picture\":null}}"
    }
  },
  "apps" : [
    "files", "markdown-editor","pdf-viewer"
  ]
}

start with yarn watch-all or using docker:

docker run --rm -it --name node-docker \
-v $PWD:/home/app -w /home/app \
-e "PORT=3000" -p 3000:3000 -p 8300:8300  \
-u node node:latest yarn watch

and finally, the users.json needs to contain the id property:

[
	{
		"id": {
			"idp": "localhost:9998",
			"opaque_id": "aaliyah_abernathy"
		},
		"subject": "c6e5995d6c7fa1986b830b78b478e6c2",
		"issuer": "localhost:9998",
		"username": "aaliyah_abernathy",
		"secret": "secret",
		"mail": "[email protected]",
		"display_name": "Aaliyah Abernathy"
	},
	{
		"id": {
			"idp": "localhost:9998",
			"opaque_id": "aaliyah_adams"
		},
		"subject": "9fb5f8d212cbf3fc55f1bf67d97ed05d",
		"issuer": "localhost:9998",
		"username": "aaliyah_adams",
		"secret": "secret",
		"mail": "[email protected]",
		"display_name": "Aaliyah Adams"
	},
	{
		"id": {
			"idp": "localhost:9998",
			"opaque_id": "aaliyah_anderson"
		},
		"subject": "a84075b398fe6a0aee1155f8ead13331",
		"issuer": "localhost:9998",
		"username": "aaliyah_anderson",
		"secret": "secret",
		"mail": "[email protected]",
		"display_name": "Aaliyah Anderson"
	}
]

@labkode labkode changed the title WIP: tracing + refactor + gateway service WIP: tracing + refactor + gateway service. Aug 13, 2019
@labkode
Copy link
Member Author

labkode commented Aug 13, 2019

Closes #188 #169 #168

@labkode
Copy link
Member Author

labkode commented Aug 13, 2019

Closes #162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants