Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Options for sticky sessions' affinity cookies #174

Merged
merged 2 commits into from
Jun 4, 2019

Conversation

gheibia
Copy link
Contributor

@gheibia gheibia commented Apr 7, 2019

"StickySession" type accepts "HttpOnly" and "Secure" options which are subsequently used to set the corresponding flags on the sticky sessions' cookies.

@gheibia
Copy link
Contributor Author

gheibia commented Apr 9, 2019

Hello, could someone please either review and feedback or merge this PR, please?

Copy link
Contributor

@juliens juliens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gheibia
Copy link
Contributor Author

gheibia commented Apr 18, 2019

I'm wondering if there is a chance for this to be merged. Traefik is using this package and having httpOnly cookies is a must if we wanna use it in production.

@gheibia
Copy link
Contributor Author

gheibia commented May 30, 2019

Is there a chance for this to be reviewed and merged?

@gheibia
Copy link
Contributor Author

gheibia commented Jun 4, 2019

Is it safe to assume that this repository is no longer maintained?

Copy link
Contributor

@emilevauge emilevauge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks for your contribution and sorry for the late response ☺️

@emilevauge emilevauge merged commit 1bcd53a into vulcand:master Jun 4, 2019
@gheibia gheibia deleted the feature/affinity_cookie_options branch June 5, 2019 22:06
@gheibia
Copy link
Contributor Author

gheibia commented Jun 6, 2019

Thank you very much.

gheibia added a commit to gheibia/oxy that referenced this pull request Jun 6, 2019
emilevauge pushed a commit that referenced this pull request Jun 11, 2019
* ensuring the CookieOption struct's fields are exported (#174)

* dep ensuring

* Updating failing test, I should pay more attention

* dep ensuring has caused problems, reverting. Although this is really strange that dep should do this
ericrpowers pushed a commit to aporeto-inc/oxy that referenced this pull request Jun 3, 2021
* Use gorilla DialContext (vulcand#158)

* Handle Te header when http2 (vulcand#157)

* fix: buffer error and go1.11. (vulcand#159)

* fix: buffer error and go1.11.

* chore: add go1.11 in Travis.

* review: comment.

* fix: use internal logger. (vulcand#160)

* fix: body should never be nil (vulcand#162)

* Pass host header for Websocket. (vulcand#163)

* feat: pass host header for Websocket.

* add tests.

* fix: golint. (vulcand#165)

* Flush when we have unannonced trailers (vulcand#168)

* Flush when we have unannonced trailers

* Remove 1.8, not supported in golint anymore

* add missing callback on close of hijacked connections (vulcand#175)

* Allowing sticky session's affinity cookies to be created with more options such as HttpOnly or Secure (vulcand#174)

* Ensuring the CookieOption struct's fields are exported (vulcand#179)

* ensuring the CookieOption struct's fields are exported (vulcand#174)

* dep ensuring

* Updating failing test, I should pay more attention

* dep ensuring has caused problems, reverting. Although this is really strange that dep should do this

* chore: migrate to go module. (vulcand#182)

* Update README.md

Go library change godoc to "pkg.go.dev"

* feat: add more cookie options. (vulcand#195)

* chore: update dependencies.

* feat: add more cookie options.

* chore: update travis configuration.

* Add Fallback setter on CircuitBreaker (vulcand#201)

Signed-off-by: Sylvain Rabot <[email protected]>

* review.

* doc: buffer.go: s/request/response/ (vulcand#172)

* doc: typo fix /serveHTTP/serveWebSocket/s (vulcand#176)

* Make the MakeRateError delay field public so that custom RateErrHandlers can be more easily written (vulcand#206)

* fix typo (vulcand#212)

* Fix panics on ratelimit period (division by zero) (vulcand#213)

* Bump to go1.16 (vulcand#214)

* Add a mechanism to format the sticky cookie value (vulcand#216)

Co-authored-by: Tom Moulard <[email protected]>
Co-authored-by: M <[email protected]>
Co-authored-by: Sylvain Rabot <[email protected]>

* Do not use global websocket.DefaultDialer

This change makes it so that each forward gets its own dialer rather
then all sharing the global `websocket.DefaultDialer`. It fixes the flaky
`TestWebSocketNumGoRoutine` test and allows `WebsocketTLSClientConfig` to
set a different TLS config than the one used in the http `RoundTripper`,
the TLS config in the http `RoundTripper` will still be used as a
fallback if one wasn't set by the user.

Adds the new `optSetter` `WebsocketNetDialContext` to set a custom
DialContet for WebSocket use.

-  `go test -run=TestWebSocketNumGoRoutine -count=100 ./forward` now
   passes. Removed the skip directive.
-  Closes vulcand#199
-  Closes vulcand#125

* Revert un-skipping test

* Update: Cleanup local and remote merged changes

Co-authored-by: SALLEYRON Julien <[email protected]>
Co-authored-by: Ludovic Fernandez <[email protected]>
Co-authored-by: Michael <[email protected]>
Co-authored-by: ravilr <[email protected]>
Co-authored-by: Amir Keibi <[email protected]>
Co-authored-by: colynn.liu <[email protected]>
Co-authored-by: Sylvain Rabot <[email protected]>
Co-authored-by: Fernandez Ludovic <[email protected]>
Co-authored-by: colynn.liu <[email protected]>
Co-authored-by: Wes Turner <[email protected]>
Co-authored-by: Ben Yanke <[email protected]>
Co-authored-by: Peter C <[email protected]>
Co-authored-by: Iman Sahebi <[email protected]>
Co-authored-by: Douglas De Toni Machado <[email protected]>
Co-authored-by: Romain <[email protected]>
Co-authored-by: Jean-Baptiste Doumenjou <[email protected]>
Co-authored-by: Tom Moulard <[email protected]>
Co-authored-by: M <[email protected]>
Co-authored-by: Clifton Kaznocha <[email protected]>
Co-authored-by: Clifton Kaznocha <[email protected]>
itsai220 added a commit to aporeto-inc/oxy that referenced this pull request Jul 13, 2021
* Use gorilla DialContext (vulcand#158)

* Handle Te header when http2 (vulcand#157)

* fix: buffer error and go1.11. (vulcand#159)

* fix: buffer error and go1.11.

* chore: add go1.11 in Travis.

* review: comment.

* fix: use internal logger. (vulcand#160)

* fix: body should never be nil (vulcand#162)

* Pass host header for Websocket. (vulcand#163)

* feat: pass host header for Websocket.

* add tests.

* fix: golint. (vulcand#165)

* Flush when we have unannonced trailers (vulcand#168)

* Flush when we have unannonced trailers

* Remove 1.8, not supported in golint anymore

* add missing callback on close of hijacked connections (vulcand#175)

* Allowing sticky session's affinity cookies to be created with more options such as HttpOnly or Secure (vulcand#174)

* Ensuring the CookieOption struct's fields are exported (vulcand#179)

* ensuring the CookieOption struct's fields are exported (vulcand#174)

* dep ensuring

* Updating failing test, I should pay more attention

* dep ensuring has caused problems, reverting. Although this is really strange that dep should do this

* chore: migrate to go module. (vulcand#182)

* Update README.md

Go library change godoc to "pkg.go.dev"

* feat: add more cookie options. (vulcand#195)

* chore: update dependencies.

* feat: add more cookie options.

* chore: update travis configuration.

* Add Fallback setter on CircuitBreaker (vulcand#201)

Signed-off-by: Sylvain Rabot <[email protected]>

* review.

* doc: buffer.go: s/request/response/ (vulcand#172)

* doc: typo fix /serveHTTP/serveWebSocket/s (vulcand#176)

* Make the MakeRateError delay field public so that custom RateErrHandlers can be more easily written (vulcand#206)

* fix typo (vulcand#212)

* Fix panics on ratelimit period (division by zero) (vulcand#213)

* Bump to go1.16 (vulcand#214)

* Add a mechanism to format the sticky cookie value (vulcand#216)

Co-authored-by: Tom Moulard <[email protected]>
Co-authored-by: M <[email protected]>
Co-authored-by: Sylvain Rabot <[email protected]>

* Do not use global websocket.DefaultDialer

This change makes it so that each forward gets its own dialer rather
then all sharing the global `websocket.DefaultDialer`. It fixes the flaky
`TestWebSocketNumGoRoutine` test and allows `WebsocketTLSClientConfig` to
set a different TLS config than the one used in the http `RoundTripper`,
the TLS config in the http `RoundTripper` will still be used as a
fallback if one wasn't set by the user.

Adds the new `optSetter` `WebsocketNetDialContext` to set a custom
DialContet for WebSocket use.

-  `go test -run=TestWebSocketNumGoRoutine -count=100 ./forward` now
   passes. Removed the skip directive.
-  Closes vulcand#199
-  Closes vulcand#125

* Revert un-skipping test

* Update: Cleanup local and remote merged changes

Co-authored-by: SALLEYRON Julien <[email protected]>
Co-authored-by: Ludovic Fernandez <[email protected]>
Co-authored-by: Michael <[email protected]>
Co-authored-by: ravilr <[email protected]>
Co-authored-by: Amir Keibi <[email protected]>
Co-authored-by: colynn.liu <[email protected]>
Co-authored-by: Sylvain Rabot <[email protected]>
Co-authored-by: Fernandez Ludovic <[email protected]>
Co-authored-by: colynn.liu <[email protected]>
Co-authored-by: Wes Turner <[email protected]>
Co-authored-by: Ben Yanke <[email protected]>
Co-authored-by: Peter C <[email protected]>
Co-authored-by: Iman Sahebi <[email protected]>
Co-authored-by: Douglas De Toni Machado <[email protected]>
Co-authored-by: Romain <[email protected]>
Co-authored-by: Jean-Baptiste Doumenjou <[email protected]>
Co-authored-by: Tom Moulard <[email protected]>
Co-authored-by: M <[email protected]>
Co-authored-by: Clifton Kaznocha <[email protected]>
Co-authored-by: Clifton Kaznocha <[email protected]>

Co-authored-by: Eric Powers <[email protected]>
Co-authored-by: SALLEYRON Julien <[email protected]>
Co-authored-by: Ludovic Fernandez <[email protected]>
Co-authored-by: Michael <[email protected]>
Co-authored-by: ravilr <[email protected]>
Co-authored-by: Amir Keibi <[email protected]>
Co-authored-by: colynn.liu <[email protected]>
Co-authored-by: Sylvain Rabot <[email protected]>
Co-authored-by: Fernandez Ludovic <[email protected]>
Co-authored-by: colynn.liu <[email protected]>
Co-authored-by: Wes Turner <[email protected]>
Co-authored-by: Ben Yanke <[email protected]>
Co-authored-by: Peter C <[email protected]>
Co-authored-by: Iman Sahebi <[email protected]>
Co-authored-by: Douglas De Toni Machado <[email protected]>
Co-authored-by: Romain <[email protected]>
Co-authored-by: Jean-Baptiste Doumenjou <[email protected]>
Co-authored-by: Tom Moulard <[email protected]>
Co-authored-by: M <[email protected]>
Co-authored-by: Clifton Kaznocha <[email protected]>
Co-authored-by: Clifton Kaznocha <[email protected]>
itsai220 added a commit to aporeto-inc/oxy that referenced this pull request Aug 4, 2021
* Use gorilla DialContext (vulcand#158)

* Handle Te header when http2 (vulcand#157)

* fix: buffer error and go1.11. (vulcand#159)

* fix: buffer error and go1.11.

* chore: add go1.11 in Travis.

* review: comment.

* fix: use internal logger. (vulcand#160)

* fix: body should never be nil (vulcand#162)

* Pass host header for Websocket. (vulcand#163)

* feat: pass host header for Websocket.

* add tests.

* fix: golint. (vulcand#165)

* Flush when we have unannonced trailers (vulcand#168)

* Flush when we have unannonced trailers

* Remove 1.8, not supported in golint anymore

* add missing callback on close of hijacked connections (vulcand#175)

* Allowing sticky session's affinity cookies to be created with more options such as HttpOnly or Secure (vulcand#174)

* Ensuring the CookieOption struct's fields are exported (vulcand#179)

* ensuring the CookieOption struct's fields are exported (vulcand#174)

* dep ensuring

* Updating failing test, I should pay more attention

* dep ensuring has caused problems, reverting. Although this is really strange that dep should do this

* chore: migrate to go module. (vulcand#182)

* Update README.md

Go library change godoc to "pkg.go.dev"

* feat: add more cookie options. (vulcand#195)

* chore: update dependencies.

* feat: add more cookie options.

* chore: update travis configuration.

* Add Fallback setter on CircuitBreaker (vulcand#201)

Signed-off-by: Sylvain Rabot <[email protected]>

* review.

* doc: buffer.go: s/request/response/ (vulcand#172)

* doc: typo fix /serveHTTP/serveWebSocket/s (vulcand#176)

* Make the MakeRateError delay field public so that custom RateErrHandlers can be more easily written (vulcand#206)

* fix typo (vulcand#212)

* Fix panics on ratelimit period (division by zero) (vulcand#213)

* Bump to go1.16 (vulcand#214)

* Add a mechanism to format the sticky cookie value (vulcand#216)

Co-authored-by: Tom Moulard <[email protected]>
Co-authored-by: M <[email protected]>
Co-authored-by: Sylvain Rabot <[email protected]>

* Do not use global websocket.DefaultDialer

This change makes it so that each forward gets its own dialer rather
then all sharing the global `websocket.DefaultDialer`. It fixes the flaky
`TestWebSocketNumGoRoutine` test and allows `WebsocketTLSClientConfig` to
set a different TLS config than the one used in the http `RoundTripper`,
the TLS config in the http `RoundTripper` will still be used as a
fallback if one wasn't set by the user.

Adds the new `optSetter` `WebsocketNetDialContext` to set a custom
DialContet for WebSocket use.

-  `go test -run=TestWebSocketNumGoRoutine -count=100 ./forward` now
   passes. Removed the skip directive.
-  Closes vulcand#199
-  Closes vulcand#125

* Revert un-skipping test

* Update: Cleanup local and remote merged changes

Co-authored-by: SALLEYRON Julien <[email protected]>
Co-authored-by: Ludovic Fernandez <[email protected]>
Co-authored-by: Michael <[email protected]>
Co-authored-by: ravilr <[email protected]>
Co-authored-by: Amir Keibi <[email protected]>
Co-authored-by: colynn.liu <[email protected]>
Co-authored-by: Sylvain Rabot <[email protected]>
Co-authored-by: Fernandez Ludovic <[email protected]>
Co-authored-by: colynn.liu <[email protected]>
Co-authored-by: Wes Turner <[email protected]>
Co-authored-by: Ben Yanke <[email protected]>
Co-authored-by: Peter C <[email protected]>
Co-authored-by: Iman Sahebi <[email protected]>
Co-authored-by: Douglas De Toni Machado <[email protected]>
Co-authored-by: Romain <[email protected]>
Co-authored-by: Jean-Baptiste Doumenjou <[email protected]>
Co-authored-by: Tom Moulard <[email protected]>
Co-authored-by: M <[email protected]>
Co-authored-by: Clifton Kaznocha <[email protected]>
Co-authored-by: Clifton Kaznocha <[email protected]>

Co-authored-by: Eric Powers <[email protected]>
Co-authored-by: SALLEYRON Julien <[email protected]>
Co-authored-by: Ludovic Fernandez <[email protected]>
Co-authored-by: Michael <[email protected]>
Co-authored-by: ravilr <[email protected]>
Co-authored-by: Amir Keibi <[email protected]>
Co-authored-by: colynn.liu <[email protected]>
Co-authored-by: Sylvain Rabot <[email protected]>
Co-authored-by: Fernandez Ludovic <[email protected]>
Co-authored-by: colynn.liu <[email protected]>
Co-authored-by: Wes Turner <[email protected]>
Co-authored-by: Ben Yanke <[email protected]>
Co-authored-by: Peter C <[email protected]>
Co-authored-by: Iman Sahebi <[email protected]>
Co-authored-by: Douglas De Toni Machado <[email protected]>
Co-authored-by: Romain <[email protected]>
Co-authored-by: Jean-Baptiste Doumenjou <[email protected]>
Co-authored-by: Tom Moulard <[email protected]>
Co-authored-by: M <[email protected]>
Co-authored-by: Clifton Kaznocha <[email protected]>
Co-authored-by: Clifton Kaznocha <[email protected]>
itsai220 added a commit to aporeto-inc/oxy that referenced this pull request Sep 2, 2021
* Fixed: Remove data race around default dialer (#6)

* Use gorilla DialContext (vulcand#158)

* Handle Te header when http2 (vulcand#157)

* fix: buffer error and go1.11. (vulcand#159)

* fix: buffer error and go1.11.

* chore: add go1.11 in Travis.

* review: comment.

* fix: use internal logger. (vulcand#160)

* fix: body should never be nil (vulcand#162)

* Pass host header for Websocket. (vulcand#163)

* feat: pass host header for Websocket.

* add tests.

* fix: golint. (vulcand#165)

* Flush when we have unannonced trailers (vulcand#168)

* Flush when we have unannonced trailers

* Remove 1.8, not supported in golint anymore

* add missing callback on close of hijacked connections (vulcand#175)

* Allowing sticky session's affinity cookies to be created with more options such as HttpOnly or Secure (vulcand#174)

* Ensuring the CookieOption struct's fields are exported (vulcand#179)

* ensuring the CookieOption struct's fields are exported (vulcand#174)

* dep ensuring

* Updating failing test, I should pay more attention

* dep ensuring has caused problems, reverting. Although this is really strange that dep should do this

* chore: migrate to go module. (vulcand#182)

* Update README.md

Go library change godoc to "pkg.go.dev"

* feat: add more cookie options. (vulcand#195)

* chore: update dependencies.

* feat: add more cookie options.

* chore: update travis configuration.

* Add Fallback setter on CircuitBreaker (vulcand#201)

Signed-off-by: Sylvain Rabot <[email protected]>

* review.

* doc: buffer.go: s/request/response/ (vulcand#172)

* doc: typo fix /serveHTTP/serveWebSocket/s (vulcand#176)

* Make the MakeRateError delay field public so that custom RateErrHandlers can be more easily written (vulcand#206)

* fix typo (vulcand#212)

* Fix panics on ratelimit period (division by zero) (vulcand#213)

* Bump to go1.16 (vulcand#214)

* Add a mechanism to format the sticky cookie value (vulcand#216)

Co-authored-by: Tom Moulard <[email protected]>
Co-authored-by: M <[email protected]>
Co-authored-by: Sylvain Rabot <[email protected]>

* Do not use global websocket.DefaultDialer

This change makes it so that each forward gets its own dialer rather
then all sharing the global `websocket.DefaultDialer`. It fixes the flaky
`TestWebSocketNumGoRoutine` test and allows `WebsocketTLSClientConfig` to
set a different TLS config than the one used in the http `RoundTripper`,
the TLS config in the http `RoundTripper` will still be used as a
fallback if one wasn't set by the user.

Adds the new `optSetter` `WebsocketNetDialContext` to set a custom
DialContet for WebSocket use.

-  `go test -run=TestWebSocketNumGoRoutine -count=100 ./forward` now
   passes. Removed the skip directive.
-  Closes vulcand#199
-  Closes vulcand#125

* Revert un-skipping test

* Update: Cleanup local and remote merged changes

Co-authored-by: SALLEYRON Julien <[email protected]>
Co-authored-by: Ludovic Fernandez <[email protected]>
Co-authored-by: Michael <[email protected]>
Co-authored-by: ravilr <[email protected]>
Co-authored-by: Amir Keibi <[email protected]>
Co-authored-by: colynn.liu <[email protected]>
Co-authored-by: Sylvain Rabot <[email protected]>
Co-authored-by: Fernandez Ludovic <[email protected]>
Co-authored-by: colynn.liu <[email protected]>
Co-authored-by: Wes Turner <[email protected]>
Co-authored-by: Ben Yanke <[email protected]>
Co-authored-by: Peter C <[email protected]>
Co-authored-by: Iman Sahebi <[email protected]>
Co-authored-by: Douglas De Toni Machado <[email protected]>
Co-authored-by: Romain <[email protected]>
Co-authored-by: Jean-Baptiste Doumenjou <[email protected]>
Co-authored-by: Tom Moulard <[email protected]>
Co-authored-by: M <[email protected]>
Co-authored-by: Clifton Kaznocha <[email protected]>
Co-authored-by: Clifton Kaznocha <[email protected]>

* fixed: forwarder did not set deadline for ws connections (#11)

* fixed: forwarder did not set deadline for ws connections

* remove debug prints

Co-authored-by: Primalmotion <[email protected]>

Co-authored-by: Eric Powers <[email protected]>
Co-authored-by: SALLEYRON Julien <[email protected]>
Co-authored-by: Ludovic Fernandez <[email protected]>
Co-authored-by: Michael <[email protected]>
Co-authored-by: ravilr <[email protected]>
Co-authored-by: Amir Keibi <[email protected]>
Co-authored-by: colynn.liu <[email protected]>
Co-authored-by: Sylvain Rabot <[email protected]>
Co-authored-by: Fernandez Ludovic <[email protected]>
Co-authored-by: colynn.liu <[email protected]>
Co-authored-by: Wes Turner <[email protected]>
Co-authored-by: Ben Yanke <[email protected]>
Co-authored-by: Peter C <[email protected]>
Co-authored-by: Iman Sahebi <[email protected]>
Co-authored-by: Douglas De Toni Machado <[email protected]>
Co-authored-by: Romain <[email protected]>
Co-authored-by: Jean-Baptiste Doumenjou <[email protected]>
Co-authored-by: Tom Moulard <[email protected]>
Co-authored-by: M <[email protected]>
Co-authored-by: Clifton Kaznocha <[email protected]>
Co-authored-by: Clifton Kaznocha <[email protected]>
Co-authored-by: primalmotion <[email protected]>
Co-authored-by: Primalmotion <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants