Does anyone know why the jws signatures created by the
golang.org/x/oauth2/jws are displayed as "invalid signature" on jwt.io ? As
far as I'm concerned it seems compliant with the JWS creation specs[0] but
it looks like jwt.io is expecting a public key or "jwk string" as well ?
Below is an ex
I have a function that encodes Go data structure in a certain way. Below is
a an example
// Data structure
type DataX struct{
X string `query:"x"`
}
func MarshalJSON(v interface)([]byte, error){
s := query.Encode(v)
return s.Bytes(), nil
}
Currently in order to force the json encoder u
I'm trying to unitest a browser wasm/js application but it seems that the
browser objects are missing. I assume that the testing package is using a
"serverside" node API so I wonder how can I make go test use a real browser
to run the tests. The test below fails
func TestTransform(t *testing.T)
Timeout: 5 * time.Second,Transport:
&AuthTransport{AuthHeader: "abcd1234"},}*
*Did that not work for you?*
*-Ben*
On Wednesday, October 27, 2021 at 1:52:18 AM UTC+3 mi...@ubo.ro wrote:
> Thanks for your help. I'm aware I can set the headers that way but the
>
// handle err
> // handle response
>
> Runnable code example here:
> https://play.golang.org/p/cocv1avzNCo
>
> And of course you can roll your own function to create a new request with
> auth headers already applied. Would this kind of thing work for you?
>
> -Ben
&
I find myself in need to handle various authentication schemes such
"proprietary" oauth2 schemes and NTLM. The easy and clean way to do it (API
wise) would be using a http.RoundTripper but looks like it forbids you from
even reading the response headers.
In the end I just made a ``func DoHTTPR
;> cases to ensure the code is correct.
>>
>> Far simpler and more robust in my opinion.
>>
>> On Oct 6, 2021, at 6:35 AM, roger peppe wrote:
>>
>>
>>
>> On Wed, 6 Oct 2021 at 09:21, mi...@ubo.ro wrote:
>>
>>> Hi Ian ,
>&
evity
return []reflect.Type{t.Field(0).Type}, nil
}
func fieldsFromResource(v reflect.Value) []interface{} {
// skip type fields looping for brevity
return []interface{}{
v.Field(0).Addr().Interface(),
v.Field(1).Addr().Interface(),
v.Field(2).Addr().Interface(),
}
}
On Wednesday, October 6, 202
I have developed a library that depends very much on reflect package. It
caches a specific type and return a function that encodes(does something
with) with that kind /type of data. Think of defining database schema using
types and generating functions to validate/update/insert data.
I reduced
Is there any proposal in Go 2.0 to remove the promotion of methods on
embedded struct fields or do you think it's a good idea ? For example in
the code below if someone marshals `Pack`, only `Animal` is actually
marshalled. Cat field is skipped. If he wants to marshal Cat as well the
developer
10 matches
Mail list logo