mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-03 19:32:48 +02:00
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:
parent
9b39deabd8
commit
aa731ae068
23 changed files with 1405 additions and 179 deletions
|
@ -1,11 +1,22 @@
|
|||
// Package databroker contains databroker protobuf definitions.
|
||||
package databroker
|
||||
|
||||
import "strings"
|
||||
|
||||
// GetUserID gets the databroker user id from a provider user id.
|
||||
func GetUserID(provider, providerUserID string) string {
|
||||
return provider + "/" + providerUserID
|
||||
}
|
||||
|
||||
// FromUserID gets the provider and provider user id from a databroker user id.
|
||||
func FromUserID(userID string) (provider, providerUserID string) {
|
||||
ps := strings.SplitN(userID, "/", 2)
|
||||
if len(ps) < 2 {
|
||||
return "", userID
|
||||
}
|
||||
return ps[0], ps[1]
|
||||
}
|
||||
|
||||
// ApplyOffsetAndLimit applies the offset and limit to the list of records.
|
||||
func ApplyOffsetAndLimit(all []*Record, offset, limit int) (records []*Record, totalCount int) {
|
||||
records = all
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue