Giter Club home page Giter Club logo

Comments (7)

x1ddos avatar x1ddos commented on August 18, 2024

@st3fan we had this discussed with @dhermes back in the days of its initial implemetation in
#15 (comment)

I know it's easy to add but may confuse users. There's also an open issue on the official bug tracker of App Engine: https://code.google.com/p/googleappengine/issues/detail?id=8848

Instead, maybe we could add a new method, something like endpoints.CurrentGoogleUser, leave CurrentUser as is and document the difference between the two.

@campoy any thoughts on this?

from go-endpoints.

st3fan avatar st3fan commented on August 18, 2024

@crhym3 Yeah you are probably right. What do you think of doing something a bit more low level and instead have something like endpoints.Claims() ? That would return something like:

// Claims represents an IdToken response.
// https://developers.google.com/accounts/docs/OpenIDConnect#obtainuserinfo
type Claims struct {
    Subject             string `json:"sub"`
    Issuer              string `json:"iss"`
    Email               string `json:"email"`
    EmailVerified       bool   `json:"email_verified"`
    Audience            string `json:"aud"`
    IssuedAt            uint   `json:"iat"`
    ExpirationTime      uint   `json:"exp"`
    AccessTokenHash     string `json:"at_hash"`
    AuthorizedPresenter string `json:"azp"`
}

Then endpoints.CurrentGoogleUser can sit on top of that.

from go-endpoints.

x1ddos avatar x1ddos commented on August 18, 2024

👍 Maybe we can then also eliminate signedJWT and just use Claims.

Woud you modify #53 with Claims and CurrentGooglUser? That would be awesome.

from go-endpoints.

st3fan avatar st3fan commented on August 18, 2024

@crhym3 Sure, I can try to find a little time between Christmas and New Year to hack on that.

from go-endpoints.

campoy avatar campoy commented on August 18, 2024

Hey @st3fan, do you have any news on this?
I'll be using this package for a course soon and I would like to make sure after this the API is as stable as possible 😄

from go-endpoints.

st3fan avatar st3fan commented on August 18, 2024

Hi @campoy .. maybe someone else can pick this up? I have abandoned the project that I was initially using this code for so it is difficult for me to work on this right now. Maybe @crhym3 has a better idea about what to do here?

from go-endpoints.

x1ddos avatar x1ddos commented on August 18, 2024

Yeah, I'll take it.

from go-endpoints.

Related Issues (20)

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.