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

Authentication middleware #1

Merged
merged 2 commits into from
Jan 23, 2018
Merged

Authentication middleware #1

merged 2 commits into from
Jan 23, 2018

Conversation

jmattheis
Copy link
Member

Should be later used like this router.POST("/message").Use(authentication.RequireWrite())

Copy link

@nicories nicories left a comment

Choose a reason for hiding this comment

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

👌

@jmattheis jmattheis merged commit 662e1f4 into master Jan 23, 2018
@jmattheis jmattheis deleted the auth-middleware branch January 23, 2018 17:04
jmattheis added a commit that referenced this pull request Jun 1, 2020
Mysql has a setting called wait_timeout, which defines the duration
after which a connection may not be used anymore. Gotify doesn't
apply this, and expects the connection to work without timeout.

The fix is to set SetConnMaxLifetime, this however, isn't the
exact counterpart for wait_timeout on mysql. wait_timeout is
relative to the last use of the connection. The go setting
uses the creation of the connection as base.

Example error output:
```
[mysql] 2020/05/31 17:53:02 packets.go:36: unexpected EOF
[GIN] 2020/05/31 - 17:53:02 | 500 |     247.062µs |        10.2.2.1 | GET      "/application"
Error #1: an error occured while authenticating user

(/proj/database/client.go:24)
[2020-05-31 17:53:02]  invalid connection
```
jmattheis added a commit that referenced this pull request Jun 1, 2020
Mysql has a setting called wait_timeout, which defines the duration
after which a connection may not be used anymore. Gotify doesn't
apply this, and expects the connection to work without timeout.

The fix is to set SetConnMaxLifetime, this however, isn't the
exact counterpart for wait_timeout on mysql. wait_timeout is
relative to the last use of the connection. The go setting
uses the creation of the connection as base.

Example error output:
```
[mysql] 2020/05/31 17:53:02 packets.go:36: unexpected EOF
[GIN] 2020/05/31 - 17:53:02 | 500 |     247.062µs |        10.2.2.1 | GET      "/application"
Error #1: an error occured while authenticating user

(/proj/database/client.go:24)
[2020-05-31 17:53:02]  invalid connection
```
jmattheis added a commit that referenced this pull request Jun 1, 2020
Mysql has a setting called wait_timeout, which defines the duration
after which a connection may not be used anymore. Gotify doesn't
apply this, and expects the connection to work without timeout.

The fix is to set SetConnMaxLifetime, this however, isn't the
exact counterpart for wait_timeout on mysql. wait_timeout is
relative to the last use of the connection. The go setting
uses the creation of the connection as base.

Example error output:
```
[mysql] 2020/05/31 17:53:02 packets.go:36: unexpected EOF
[GIN] 2020/05/31 - 17:53:02 | 500 |     247.062µs |        10.2.2.1 | GET      "/application"
Error #1: an error occured while authenticating user

(/proj/database/client.go:24)
[2020-05-31 17:53:02]  invalid connection
```
@EVOTk EVOTk mentioned this pull request Sep 4, 2020
6 tasks
@NightHawkATL NightHawkATL mentioned this pull request Mar 25, 2023
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants