Giter VIP home page Giter VIP logo

Comments (4)

alexrudd avatar alexrudd commented on June 15, 2024 2

Oh my god - they've migrated back to map[string]string from map[string]*string. I literally just updated the package to better support the pointer maps 😭

I think what's happening in your case is in the conversion from map[string]string to map[string]*string you're referencing a loop scoped variable that has its value changed every iteration:

for k, v := range resp.ChallengeParameters {
    chp[k] = &v
}

should be:

for k, v := range resp.ChallengeParameters {
    scopedV := v
    chp[k] = &scopedV
}

The easiest fix will be to use v2 of this repo, as that uses map[string]string throughout. In your above example just replace github.com/alexrudd/cognito-srp/v3 with github.com/alexrudd/cognito-srp/v2.

I'll release a new version at the weekend so we're back to map[string]string

from cognito-srp.

shved avatar shved commented on June 15, 2024

BTW thanks for the work you do! All the AWS API is so frustrating, and you're trying to make it better to work with ❤️

from cognito-srp.

shved avatar shved commented on June 15, 2024

Thanks alex! So shame I've fallen into this common mistake with iterations.

BTW dont clue a single reason for them to use string pointers instead of strings. Thanks for help again.

from cognito-srp.

alexrudd avatar alexrudd commented on June 15, 2024

Got a chance to fix this. Released v4.0.0 which can be imported using cognitosrp "github.com/alexrudd/cognito-srp/v4"

Thanks for opening the issue :)

from cognito-srp.

Related Issues (6)

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.