Documentation
¶
Overview ¶
Package user synchronises email addresses from an Azure Active Directory tenancy. It is a read-only adapter, so it does not provide any functionality to create or delete entries in AD.
Requirements ¶
In order to synchronise with Azure AD, you'll need to ensure you have an App Registration with the following API Permissions:
- User.Read.All
You will also need credentials for the App Registration to be configured appropriately in the environment using one of the default authentication mechanisms.
Index ¶
Examples ¶
Constants ¶
const Filter gosync.ConfigKey = "filter"
Filter is an optional filter for filtering down the users to return See the reference for more information on filter queries.
Variables ¶
This section is empty.
Functions ¶
func WithClient ¶ added in v0.14.1
func WithClient(client iClient) func(u *User)
WithClient provides a mechanism to pass a custom client to the adapter.
func WithFilter ¶
WithFilter provides a mechanism to set the Microsoft Graph query filter when instantiating a new User adapter with the user.New method.
Types ¶
type User ¶
func Init ¶
func Init( _ context.Context, config map[gosync.ConfigKey]string, configFns ...gosync.ConfigFn[*User], ) (*User, error)
Init creates a new Adapter. By default, an Azure Graph Service Client will be created using the default credentials in the environment.
Example ¶
package main import ( "context" "log" gosync "github.com/ovotech/go-sync" "github.com/ovotech/go-sync/adapters/azuread/user" ) func main() { adapter, err := user.Init(context.TODO(), map[gosync.ConfigKey]string{ user.Filter: "endsWith(mail, '@example.com')", }) if err != nil { log.Fatal(err) } gosync.New(adapter) }
Output: