mmmorris1975 / aws-runas

aws-runas rewritten in Go
MIT License
87 stars 20 forks source link

browser-client-SAMLResponse: Parse response query string to get SAMLResponse key value pair #106

Closed NemindaPiyasena closed 1 year ago

NemindaPiyasena commented 1 year ago
mmmorris1975 commented 1 year ago

Thank you for taking the time to make this contribution. Since the payload you are seeing is starting to look like a URL query string, would it make more sense to do something like:

qs, err := url.ParseQuery(ev.Request.PostData)
if err != nil {
    c.Logger.Errorf("Error parsing SAMLResponse: %v", err)
    return
}
escsaml := qs.Get("SAMLResponse")

I think either approach will work, but wanted to propose an alternative to see if one feels like a better solution compared to the other. For what we're trying to accomplish here, I don't see a clear preference for how this is addressed.

NemindaPiyasena commented 1 year ago

Hi @mmmorris1975

Thank you for your input. Parsing as a query string makes more sense in the context. I have made the changes accordingly.

mmmorris1975 commented 1 year ago

Thanks again for taking time to make aws-runas better! I'll work on getting this added in a new release