lparkes / swagger-codegen-generators

Apache License 2.0
0 stars 0 forks source link

[Go] contexts used in every API call #10

Closed lparkes closed 1 year ago

lparkes commented 1 year ago

The Go target has a required context parameter in every API call, using the context to pass in optional authentication information. This is ugly and wrong. We should be doing it the same way as the Java target.

There was unfortunately a burst of posts from the blogerati showing how to do web authentication using contexts shortly after the context package was released. This does all seem to be very wrong. I'm sure I have seen an official posting from the Go devs saying that authentication is not an appropriate use of contexts, but I can't find that document now.

The official Go documentation states that contexts are for per-request specific information such as deadlines and cancelation. Authentication is specific to the entire API client.

lparkes commented 1 year ago

Implemented