## Description Exports functionality useful for external services/validators ## Type of change <!--- Please check the type of change your PR introduces: ---> - [x] 🌻 Feature - [ ] 🐛 Bugfix - [ ] 🗺️ Documentation - [ ] 🤖 Test - [ ] 💻 CI/Deployment - [ ] 🐹 Trivial/Minor ## Test Plan <!-- How will this be tested prior to merging.--> - [ ] 💪 Manual - [x] ⚡ Unit test - [ ] 💚 E2E
20 lines
485 B
Go
20 lines
485 B
Go
package m365
|
|
|
|
import (
|
|
"github.com/pkg/errors"
|
|
|
|
"github.com/alcionai/corso/src/internal/connector"
|
|
"github.com/alcionai/corso/src/pkg/account"
|
|
)
|
|
|
|
// Users returns a list of users in the specified M365 tenant
|
|
// TODO: Implement paging support
|
|
func Users(m365Account account.Account) ([]string, error) {
|
|
gc, err := connector.NewGraphConnector(m365Account)
|
|
if err != nil {
|
|
return nil, errors.Wrap(err, "could not initialize M365 graph connection")
|
|
}
|
|
|
|
return gc.GetUsers(), nil
|
|
}
|