Giter Site home page Giter Site logo

go-msgraph's People

Contributors

emalzer avatar floren avatar prskr avatar terratalpi avatar wtiger001 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

go-msgraph's Issues

Please add 'jobTitle' to user struct

Is your feature request related to a problem? Please describe.
Please add the jobTitle to the user struct

Describe the solution you'd like
Please add the jobTitle to the user struct

Describe alternatives you've considered
N/A

Additional context
Just need to be able to read and write the jobTitle

How to use a proxy or custom HTTP client?

The network connection is sometimes bad in my area to connect to Graph API endpoint. How to use a proxy like Golang builtin http.Client in the graphClient?

graphClient, err := msgraph.NewGraphClient(tenantId, clientId, clientSecret)
err := graphClient.MakePUTAPICall(url, nil, fileBytes, &res) <---- timeout error
if err != nil {
	panic(err)
}

ListMembers function not working as expected. Returning empty msgraph.Users list

When using the below code, groups returns with all of the expected information, but groupMembers returns with only the object ID and all other fields are empty. I can confirm in azure portal that the object IDs are correct, and we get one empty object per group member, but no data.

	graphClient, err := msgraph.NewGraphClient(tenantID, clientID, clientSecret)
	if err != nil {
		fmt.Println("Credentials are probably wrong or system time is not synced: ", err)
	}

	groups, err := graphClient.ListGroups()
	if err != nil {
		fmt.Println("Error", err)
	}

	groupMembers, err:= groups[0].ListMembers()
	if err != nil {
		fmt.Println("Error", err)
	}

	json.NewEncoder(res).Encode(groupMembers)

The response from ListMembers() looks like this:

[ {"id":"99f2f82b-08f8-4054-b4c8-458698aaa861","businessPhones":[],"displayName":"","givenName":"","mail":"","mobilePhone":"","preferredLanguage":"","surname":"","userPrincipalName":""},{"id":"cb53abcc-47e3-4843-b9c4-5f93f247f1ca","businessPhones":[],"displayName":"","givenName":"","mail":"","mobilePhone":"","preferredLanguage":"","surname":"","userPrincipalName":""} ]

How can we return a list of members for a group using msgraph?

support use of delegate token

The existing api assumes that the client application has permission to act without user delegation. In my application, the library is used behind an oauth2 proxy. The proxy does the oauth2 dance and passes back a header with the negotiated token. In this context, I need to use the token the proxy has negotiated and not have the client library refresh the token.

Steps to recreate:

  1. create app in azure
  2. setup permissions for calendar.read and user.read
  3. obtain tenant id, client id and client secret
  4. setup oauth2 proxy to use the settings in step 2.
  5. start up a backend that receives the token via X-Forwarded-Access-Token header.

Observed behavior:
Client can't "refresh" token because its permission scope is not user.read.all

Allow to use advanced OData query options

OData/MSGraph offers advanced query parameters to

  • $filter
  • $search
  • $select

in GET or GETALL requests which would be nice to use e.g. to search for groups by name if you don't want to force your users to lookup ObjectIDs ๐Ÿ˜„

Furthermore if one adds optional query arguments it would be nice to allow to pass a context.Context to cancel requests.

I will provide a PR to further discuss how to allow optional query parameters

Need to be able to override LoginBaseURL and BaseUrl

Is your feature request related to a problem? Please describe.
Yes. When I go to connect the client I am receiving:

AADSTS900382: Confidential Client is not supported in Cross Cloud request

I am using the Azure government cloud, which has a login url of "https://login.microsoftonline.us" and a base url of "https://graph.microsoft.us"

Describe the solution you'd like
I would like to be able to pass in an option to the client creation that includes those urls

Describe alternatives you've considered
To make it backward compatible then add ... option objects with a SetBaseUrl() and SetLoginUrl() methods to stay api consisten

Official Microsoft Graph Go SDK

Hello everyone ๐Ÿ‘‹

Vincent here from the Microsoft Graph SDKs team. I'm reaching out to announce we're working on an official Go SDK, we haven't announced the community preview yet as there are still a number of things we need to work through, but I though I'd reach out to give you an opportunity to provide feedback before anybody else!

A few benefits from this new SDK:

  • Fluent style APIs to all endpoints of the API
  • Contains all the models of the API
  • Is updated weekly to always be in sync with the API
  • Supports v1 and beta
  • Relies on Azure identity to provide support for multiple authentication flows (you also can implement your own authentication provider)
  • Provides middleware for Retry handling and Redirect handling (more to come)
  • And many more features to come!

As with every pre-previews, we have a list of known limitations we're working through.

We'd love for you to pop by the repos under our org, give it a try, and give us feedback on your experience with this new SDK.

ListCalendarView missing

Hi all,
in the readme I find the followings:

events, err := graphClient.ListCalendarView("[email protected]", startTime, endTime)

but in the source code I can't find the method.
Is it missing of just not implemented yet?
Is there a way to get the calendar items of a specific user?

Add a recurse option for `ListQueryOption` to allow e.g. listing members of nested groups

Is your feature request related to a problem? Please describe.

When using the ListMembers function of Group only direct members are returned and nested groups are omitted completely.
This way there's no way to get members of nested groups at all because you don't get the nested groups and there's no recurse option.

Describe the solution you'd like

By adding a generic recurse option every List function could at least consider if recursion can be implemented for this very call.
In case of Group.ListMembers it could optionally recurse nested groups and return also these users.

Alternatively a more generic API could be considered:

Instead of returning (Users. error) e.g. a new Group.MemberNodes(...) (Nodes, error) function could be added.

Given the following context:

type NodeType string

const (
    NodeTypeGroup NodeType = "#microsoft.graph.group"
    NodeTypeUser  NodeType = "#microsoft.graph.user"
)

type Node interface {
    GetType() NodeType
    GetID() string
    GetDisplayName() string
    GetMail() string
    // ... further common attributes?
}

type Nodes []Node

func (n Nodes) Users() Users {
    // ...
}

func (n Nodes) Groups() Groups {
    // ...
}

User and Group can both implement the Node interface and can be returned as part of the Nodes response.
Afterwards checking either the NodeType or the .(type) of the struct allows filtering for users and handle nested groups without a recursion option.

Of course a breaking change to ListMembers of Group would also be possible.

I'd be happy to provide a PR as soon as a design decision has been made about if and how to implement this ๐Ÿ˜Š

GraphClient: enable simultaneous use for multiple cloud endpoints

The use of a different MS Graph API endpoint than the global endpoint has been introduced with #9 and pull-request #11.

There are multiple msgraph API endpoints currently available, see https://docs.microsoft.com/en-us/azure/active-directory/develop/authentication-national-cloud#azure-ad-authentication-endpoints.

When LoginBaseURL and BaseURL from constants.go, this is a package setting. Maybe someone wants to use two different MS Graph API endpoints at the same time --> move from package-variable to GraphClient variable.

Implement CreateUser

Is your feature request related to a problem? Please describe.
CreateUser is a part of the User API for MS Graph that is unimplemented.

Describe the solution you'd like
Implement the CreateUser method

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.