directory.Group entry for groups (#1118)

* store directory groups separate from directory users

* fix group lookup, azure display name

* remove fields restriction

* fix test

* also support email

* use Email as name for google'

* remove changed file

* show groups on dashboard

* fix test

* re-add accidentally removed code
This commit is contained in:
Caleb Doxsey 2020-07-22 11:28:53 -06:00 committed by GitHub
parent 489cdd8b63
commit 1ad243dfd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 525 additions and 209 deletions

View file

@ -16,12 +16,15 @@ import (
"github.com/pomerium/pomerium/pkg/grpc/directory"
)
// A Group is a directory Group.
type Group = directory.Group
// A User is a directory User.
type User = directory.User
// A Provider provides user group directory information.
type Provider interface {
UserGroups(ctx context.Context) ([]*User, error)
UserGroups(ctx context.Context) ([]*Group, []*User, error)
}
// GetProvider gets the provider for the given options.
@ -101,6 +104,6 @@ func GetProvider(options *config.Options) Provider {
type nullProvider struct{}
func (nullProvider) UserGroups(ctx context.Context) ([]*User, error) {
return nil, nil
func (nullProvider) UserGroups(ctx context.Context) ([]*Group, []*User, error) {
return nil, nil, nil
}