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

Integrate ocis-accounts #239

Merged
merged 1 commit into from
Apr 30, 2020
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
6 changes: 6 additions & 0 deletions changelog/unreleased/integrate-accounts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Change: Start ocis-accounts with the ocis server command

Starts ocis-accounts in single binary mode (./ocis server). This service stores the user-account information.

https://github.com/owncloud/product/issues/25
https://github.com/owncloud/ocis/pull/239/files
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
github.com/micro/micro/v2 v2.0.1-0.20200210100719-f38a1d8d5348
github.com/openzipkin/zipkin-go v0.2.2
github.com/owncloud/flaex v0.2.0
github.com/owncloud/ocis-accounts v0.1.1
github.com/owncloud/ocis-glauth v0.4.0
github.com/owncloud/ocis-graph v0.0.0-20200318175820-9a5a6e029db7
github.com/owncloud/ocis-graph-explorer v0.0.0-20200210111049-017eeb40dc0c
Expand Down
18 changes: 3 additions & 15 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ github.com/aws/aws-sdk-go v1.19.45/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpi
github.com/aws/aws-sdk-go v1.23.0/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.25.31/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.28.2/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-sdk-go v1.30.7 h1:IaXfqtioP6p9SFAnNfsqdNczbR5UNbYqvcZUSsCAdTY=
github.com/aws/aws-sdk-go v1.30.7/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/aws/aws-sdk-go v1.30.12 h1:KrjyosZvkpJjcwMk0RNxMZewQ47v7+ZkbQDXjWsJMs8=
github.com/aws/aws-sdk-go v1.30.12/go.mod h1:5zCpMtNQVjRREroY7sYe8lOMRSxkhG6MZveU8YkpAk0=
github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc=
Expand Down Expand Up @@ -219,13 +217,9 @@ github.com/crewjam/httperr v0.0.0-20190612203328-a946449404da/go.mod h1:+rmNIXRv
github.com/crewjam/saml v0.4.0 h1:gvSlboe4BO1APaU2eDdsbql3itRat310Q5qs2Seim2k=
github.com/crewjam/saml v0.4.0/go.mod h1:geQUbAAwmTKNJFDzoXaTssZHY26O89PHIm3K3YWjWnI=
github.com/cs3org/go-cs3apis v0.0.0-20191128165347-19746c015c83/go.mod h1:IsVGyZrOLUQD48JIhlM/xb3Vz6He5o2+W0ZTfUGY+IU=
github.com/cs3org/go-cs3apis v0.0.0-20200408065125-6e23f3ecec0a h1:+enFdliTCV/aaLAvLmeka/r9wUoEypngV4JD5Gy92Uc=
github.com/cs3org/go-cs3apis v0.0.0-20200408065125-6e23f3ecec0a/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/cs3org/go-cs3apis v0.0.0-20200423154403-462ce7762d4a h1:+ucCukFjYS+L7Sg3GbXoD0M0Pz6CQEhJ9HC97GHc9TU=
github.com/cs3org/go-cs3apis v0.0.0-20200423154403-462ce7762d4a/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/cs3org/reva v0.0.2-0.20200115110931-4c7513415ec5/go.mod h1:Hk3eCcdhtv4eIhKvRK736fQuOyS1HuHnUcz0Dq6NK1A=
github.com/cs3org/reva v0.1.1-0.20200416050838-5fc8adf27f83 h1:UScjXmYUPW0XSolajvxoBixIRVQRldYPmfeF1TI/CuY=
github.com/cs3org/reva v0.1.1-0.20200416050838-5fc8adf27f83/go.mod h1:baGkmcec/4WxTux30nbIz05RWKaueMGTkDihcVxLp8Y=
github.com/cs3org/reva v0.1.1-0.20200427161359-c1549a8110eb h1:NmIewIBHshEpn8q1pezRDoG2B7hRVgnWYLX1XSVjx1E=
github.com/cs3org/reva v0.1.1-0.20200427161359-c1549a8110eb/go.mod h1:I20R3mjgLU9y9Ol3pIckY3M948l7mkJORdpfSR9w9tM=
github.com/davecgh/go-spew v0.0.0-20151105211317-5215b55f46b2/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down Expand Up @@ -499,6 +493,7 @@ github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht
github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k=
github.com/jmespath/go-jmespath v0.3.0 h1:OS12ieG61fsCg5+qLJ+SsW9NicxNkg3b25OyT2yCeUc=
github.com/jmespath/go-jmespath v0.3.0/go.mod h1:9QtRXoHjLGCJ5IBSaohpXITPlowMeeYCZ7fLUTSywik=
github.com/joho/godotenv v1.3.0 h1:Zjp+RcGpHhGlrMbJzXTrZZPrWj+1vfm90La1wgB6Bhc=
github.com/joho/godotenv v1.3.0/go.mod h1:7hK45KPybAkOC6peb+G5yklZfMxEjkZhHbwpqxOKXbg=
github.com/jonboulle/clockwork v0.1.0 h1:VKV+ZcuP6l3yW9doeqz6ziZGgcynBVQO+obU0+0hcPo=
github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo=
Expand Down Expand Up @@ -746,6 +741,8 @@ github.com/owncloud/flaex v0.2.0 h1:3FLf8oyMgA6HLK7w4+VJ5N1oVA8G7MptLCVjfxxIaww=
github.com/owncloud/flaex v0.2.0/go.mod h1:jip86t4OVURJTf8CM/0e2qcji/Y4NG3l2lR8kex4JWw=
github.com/owncloud/ocis-accounts v0.1.0 h1:6YjvRWNW26QHOqOFONg0HeogxhxaVGS1S2AoCUgzE3M=
github.com/owncloud/ocis-accounts v0.1.0/go.mod h1:eoOPfuFCJ23n2csSMzapfjzVhG2kt8sQ2tu/9J+SwsA=
github.com/owncloud/ocis-accounts v0.1.1 h1:WYQ/KLbNZB7EmCZQJTvrySfWFuS0m9oM0gTkyKrjFOM=
github.com/owncloud/ocis-accounts v0.1.1/go.mod h1:2bAek8WWDb7jPNpIzefi2+4jqpI1U6dgpzjyRFX94Zg=
github.com/owncloud/ocis-glauth v0.4.0 h1:L+S2UzkJJv5NWBVnTIZObdFz5zvKz8L0crIWbXtTF8o=
github.com/owncloud/ocis-glauth v0.4.0/go.mod h1:dZzZdRkssaEiDg3UdlQL+kozVfpyVUhdUd0uGcTdCH8=
github.com/owncloud/ocis-graph v0.0.0-20200318175820-9a5a6e029db7 h1:gT0GyIOoR7XtpZ7sIxVJSckcz/nueGB1Cm1xNaflXQ0=
Expand All @@ -759,13 +756,8 @@ github.com/owncloud/ocis-konnectd v0.3.1 h1:d886SLx6oR2ldNAvJC8TB/0+XnYCQiNFFTGz
github.com/owncloud/ocis-konnectd v0.3.1/go.mod h1:kOBYY8P1s2KJRmUc//bThSFtSIH6NO1+6WogmrHcMRY=
github.com/owncloud/ocis-ocs v0.0.0-20200318181133-cc66a0531da7 h1:AHKA5xrnSBOdFjVTkaXzCyJl7vhOVklJD/b/T6Ky/oI=
github.com/owncloud/ocis-ocs v0.0.0-20200318181133-cc66a0531da7/go.mod h1:W0ry/qPP85Yw/KKd0IoOdjOI914bvzOaEeM9bzRuwaQ=
github.com/owncloud/ocis-phoenix v0.5.0 h1:ZePMjGBz5THBo7SfKgdnSNfaOiNX9IMOhiBhC7pAIJ0=
github.com/owncloud/ocis-phoenix v0.5.0/go.mod h1:4ig0+lfBK60GJLUMbvJdhtftrKEOpdBsGt7DVN/AmoY=
github.com/owncloud/ocis-phoenix v0.5.1-0.20200424121943-652060b9c8d4 h1:NcLpdKVfNeiIqAL5b1lFffuYRklXFSS1kkF22fW/5JQ=
github.com/owncloud/ocis-phoenix v0.5.1-0.20200424121943-652060b9c8d4/go.mod h1:4ig0+lfBK60GJLUMbvJdhtftrKEOpdBsGt7DVN/AmoY=
github.com/owncloud/ocis-phoenix v0.6.0 h1:p++botHH6WizAiMXELBTDRw9oVqcjyMliLf5BLgrDxw=
github.com/owncloud/ocis-phoenix v0.6.0/go.mod h1:uTJsJV9mTnWmMOgg1YaxUaqmAjH5P+sikp9tZQKSwpM=
github.com/owncloud/ocis-pkg v1.2.1-0.20191217084055-eab942498596 h1:3aMNmuDCIdKsaa4YdVTQEBJMjGz8KiuIB/+xlJUCT3k=
github.com/owncloud/ocis-pkg v1.2.1-0.20191217084055-eab942498596/go.mod h1:Wo0QfOmhadh2vNcUoQIsw2yaOT3zeftk+xaOOwP3y88=
github.com/owncloud/ocis-pkg v1.3.0 h1:2fkgvfd/spTjschuulYMHRuzxkCGGXae9ocebVYkm74=
github.com/owncloud/ocis-pkg v1.3.0/go.mod h1:Wo0QfOmhadh2vNcUoQIsw2yaOT3zeftk+xaOOwP3y88=
Expand All @@ -777,13 +769,9 @@ github.com/owncloud/ocis-pkg/v2 v2.2.1 h1:LK7WxHYugEFQ9NHTOz0EP8DRjbt51wXhyqruV0
github.com/owncloud/ocis-pkg/v2 v2.2.1/go.mod h1:MXv7QzsYsu4YWuyJxhq1kLLmJa/r5gbqHe1FXulMHaw=
github.com/owncloud/ocis-proxy v0.3.1 h1:49weyxHNQjOeWTaf31LlQp5uul8ZoJenfe9o4P4fetU=
github.com/owncloud/ocis-proxy v0.3.1/go.mod h1:HwsIKM9etps19bBVwjOX+Jrv9pfDvw3azvaHaxMiBCI=
github.com/owncloud/ocis-reva v0.2.1-0.20200422092105-7d8638a67485 h1:oi/XK5qULuMcMXd/G5FYwFCH2f1UvFZ6rqx1+Rz+MEg=
github.com/owncloud/ocis-reva v0.2.1-0.20200422092105-7d8638a67485/go.mod h1:Rh/DEL4DJFCqVi1dMXR8eGrYQ/Qryy2hZj8HCGl63C8=
github.com/owncloud/ocis-reva v0.2.1 h1:4aOOJT7tn9GCeNCM+qr33de2xobW4nAKJUvbb0BpL2k=
github.com/owncloud/ocis-reva v0.2.1/go.mod h1:Ew9XgScQzFbdpSZySq1PHVISgd4y03Ms62lFy+mAx2s=
github.com/owncloud/ocis-thumbnails v0.0.0-20200318131505-e0ab0b37a5a4/go.mod h1:VmCoxwitTs6oRxIaGz6xridLPwA6ReRMej22jBhkRIM=
github.com/owncloud/ocis-thumbnails v0.1.0 h1:rUzNeu5bKH01WnG/EKJZGy6rnlqZ4tlArDaUwIZK0hM=
github.com/owncloud/ocis-thumbnails v0.1.0/go.mod h1:VmCoxwitTs6oRxIaGz6xridLPwA6ReRMej22jBhkRIM=
github.com/owncloud/ocis-thumbnails v0.1.2-0.20200422124828-f92a40879feb h1:eLvwnJ88x0erIsjMEa2b6dI1pBTEz52eMKrBPJfIOLM=
github.com/owncloud/ocis-thumbnails v0.1.2-0.20200422124828-f92a40879feb/go.mod h1:N9zPXTyUmQ7vi19Y5EO94MRw19up/3SK3SSX5P3PvFw=
github.com/owncloud/ocis-webdav v0.1.0 h1:A7wI6knfIDwvlAMrW+YOmP9gxF7bxAtsgIuFs11+fM4=
Expand Down
40 changes: 40 additions & 0 deletions pkg/command/accounts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package command

import (
"github.com/micro/cli/v2"
"github.com/owncloud/ocis-accounts/pkg/command"
svcconfig "github.com/owncloud/ocis-accounts/pkg/config"
"github.com/owncloud/ocis-accounts/pkg/flagset"
"github.com/owncloud/ocis/pkg/config"
"github.com/owncloud/ocis/pkg/register"
)

// AccountsCommand is the entrypoint for the accounts command.
func AccountsCommand(cfg *config.Config) *cli.Command {
return &cli.Command{
Name: "accounts",
Usage: "Start accounts server",
Category: "Extensions",
Flags: flagset.ServerWithConfig(cfg.Accounts),
Action: func(c *cli.Context) error {
accountsCommand := command.Server(configureAccounts(cfg))
if err := accountsCommand.Before(c); err != nil {
return err
}

return cli.HandleAction(accountsCommand.Action, c)
},
}
}

func configureAccounts(cfg *config.Config) *svcconfig.Config {
cfg.Accounts.Log.Level = cfg.Log.Level
cfg.Accounts.Log.Pretty = cfg.Log.Pretty
cfg.Accounts.Log.Color = cfg.Log.Color

return cfg.Accounts
}

func init() {
register.AddCommand(AccountsCommand)
}
9 changes: 6 additions & 3 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package config

import (
accounts "github.com/owncloud/ocis-accounts/pkg/config"
glauth "github.com/owncloud/ocis-glauth/pkg/config"
graphExplorer "github.com/owncloud/ocis-graph-explorer/pkg/config"
graph "github.com/owncloud/ocis-graph/pkg/config"
Expand Down Expand Up @@ -58,22 +59,24 @@ type Config struct {
GRPC GRPC
Tracing Tracing

Accounts *accounts.Config
Graph *graph.Config
GraphExplorer *graphExplorer.Config
GLAuth *glauth.Config
Hello *hello.Config
Konnectd *konnectd.Config
OCS *ocs.Config
Phoenix *phoenix.Config
WebDAV *webdav.Config
Reva *reva.Config
GLAuth *glauth.Config
Proxy *proxy.Config
Reva *reva.Config
Thumbnails *thumbnails.Config
WebDAV *webdav.Config
}

// New initializes a new configuration with or without defaults.
func New() *Config {
return &Config{
Accounts: accounts.New(),
Graph: graph.New(),
GraphExplorer: graphExplorer.New(),
Hello: hello.New(),
Expand Down
1 change: 1 addition & 0 deletions pkg/micro/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ var (
"reva-storage-eos-data",
"reva-storage-oc",
"reva-storage-oc-data",
"accounts",
"glauth",
"konnectd",
"proxy", // TODO rename this command. It collides with micro's `proxy`
Expand Down