directory: add explicit RefreshUser endpoint for faster sync (#1460)

* directory: add explicit RefreshUser endpoint for faster sync

* add test

* implement azure

* update api call

* add test for azure User

* implement github

* implement AccessToken, gitlab

* implement okta

* implement onelogin

* fix test

* fix inconsistent test

* implement auth0
This commit is contained in:
Caleb Doxsey 2020-10-05 08:23:15 -06:00 committed by GitHub
parent 9b39deabd8
commit aa731ae068
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 1405 additions and 179 deletions

8
cache/cache.go vendored
View file

@ -7,6 +7,7 @@ import (
"context"
"fmt"
"net"
"sync"
"google.golang.org/grpc"
"gopkg.in/tomb.v2"
@ -33,6 +34,9 @@ type Cache struct {
localGRPCConnection *grpc.ClientConn
dataBrokerStorageType string //TODO remove in v0.11
deprecatedCacheClusterDomain string //TODO: remove in v0.11
mu sync.Mutex
directoryProvider directory.Provider
}
// New creates a new cache service.
@ -90,6 +94,7 @@ func (c *Cache) OnConfigChange(cfg *config.Config) {
// Register registers all the gRPC services with the given server.
func (c *Cache) Register(grpcServer *grpc.Server) {
databroker.RegisterDataBrokerServiceServer(grpcServer, c.dataBrokerServer)
directory.RegisterDirectoryServiceServer(grpcServer, c)
}
// Run runs the cache components.
@ -132,6 +137,9 @@ func (c *Cache) update(cfg *config.Config) error {
ClientID: cfg.Options.ClientID,
ClientSecret: cfg.Options.ClientSecret,
})
c.mu.Lock()
c.directoryProvider = directoryProvider
c.mu.Unlock()
dataBrokerClient := databroker.NewDataBrokerServiceClient(c.localGRPCConnection)