Skip to content

Commit

Permalink
Merge pull request #7 from owncloud/oidc-standard-claims
Browse files Browse the repository at this point in the history
Oidc Standard Claims as Account Data
  • Loading branch information
refs authored Feb 13, 2020
2 parents eb42685 + ed8a8af commit 5a7f2d4
Show file tree
Hide file tree
Showing 11 changed files with 489 additions and 72 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ IMPORT := github.com/owncloud/$(NAME)
BIN := bin
DIST := dist
HUGO := hugo
PROTO_VERSION := v0
PROTO_SRC := pkg/proto/$(PROTO_VERSION)/*.proto

ifeq ($(OS), Windows_NT)
EXECUTABLE := $(NAME).exe
Expand Down Expand Up @@ -153,3 +155,7 @@ docs: docs-copy docs-build
.PHONY: watch
watch:
go run github.com/cespare/reflex -c reflex.conf

.PHONY: pb
pb:
protoc --go_out=. --micro_out=. $(PROTO_SRC)
21 changes: 3 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,13 @@ module github.com/owncloud/ocis-accounts
go 1.13

require (
github.com/coreos/etcd v3.3.18+incompatible // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.3.2
github.com/grpc-ecosystem/grpc-gateway v1.9.4 // indirect
github.com/json-iterator/go v1.1.9 // indirect
github.com/lucas-clemente/quic-go v0.14.1 // indirect
github.com/micro/cli/v2 v2.1.1
github.com/micro/go-micro v1.18.0
github.com/miekg/dns v1.1.27 // indirect
github.com/nats-io/nats-server/v2 v2.1.2 // indirect
github.com/micro/go-micro/v2 v2.0.0
github.com/oklog/run v1.1.0
github.com/owncloud/ocis-hello v0.0.0-20200114105804-61741477dcec
github.com/owncloud/ocis-pkg v1.3.0
github.com/pkg/errors v0.9.1 // indirect
github.com/restic/calens v0.2.0 // indirect
github.com/tmc/grpc-websocket-proxy v0.0.0-20200122045848-3419fae592fc // indirect
go.uber.org/zap v1.13.0 // indirect
golang.org/x/crypto v0.0.0-20200117160349-530e935923ad // indirect
golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f // indirect
golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa // indirect
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect
golang.org/x/tools v0.0.0-20191216173652-a0e659d51361 // indirect
google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1 // indirect
google.golang.org/grpc v1.26.0 // indirect
github.com/owncloud/ocis-pkg/v2 v2.0.1
github.com/restic/calens v0.2.0
)
36 changes: 36 additions & 0 deletions go.sum

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ import (
"github.com/oklog/run"
"github.com/owncloud/ocis-accounts/pkg/config"
"github.com/owncloud/ocis-accounts/pkg/micro/grpc"
oclog "github.com/owncloud/ocis-pkg/v2/log"
)

var (
logger oclog.Logger
)

// Server is the entry point for the server command.
Expand Down Expand Up @@ -59,12 +64,17 @@ func Server(cfg *config.Config) *cli.Command {
Destination: &cfg.Server.Address,
},
},
Before: func(c *cli.Context) error {
logger = oclog.NewLogger(oclog.Name(cfg.Server.Name))
return nil
},
Action: func(c *cli.Context) error {
gr := run.Group{}
ctx, cancel := context.WithCancel(context.Background())

defer cancel()
service := grpc.NewService(
grpc.Logger(logger),
grpc.Context(ctx),
grpc.Config(cfg),
grpc.Name(cfg.Server.Name),
Expand Down
3 changes: 2 additions & 1 deletion pkg/micro/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package grpc
import (
"github.com/owncloud/ocis-accounts/pkg/proto/v0"
svc "github.com/owncloud/ocis-accounts/pkg/service/v0"
"github.com/owncloud/ocis-pkg/service/grpc"
"github.com/owncloud/ocis-pkg/v2/service/grpc"
)

// NewService initializes a new go-micro service ready to run
Expand All @@ -15,6 +15,7 @@ func NewService(opts ...Option) grpc.Service {
grpc.Context(options.Context),
grpc.Address(options.Address),
grpc.Namespace(options.Namespace),
grpc.Logger(options.Logger),
)

hdlr := svc.New(options.Config)
Expand Down
2 changes: 1 addition & 1 deletion pkg/micro/grpc/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"

"github.com/owncloud/ocis-accounts/pkg/config"
"github.com/owncloud/ocis-pkg/log"
"github.com/owncloud/ocis-pkg/v2/log"
)

// Option defines a single option function.
Expand Down
Loading

0 comments on commit 5a7f2d4

Please sign in to comment.