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

fix(sqlcon): Parse DSN manually instead of using url.Parse #119

Merged
merged 1 commit into from
Mar 1, 2020
Merged

fix(sqlcon): Parse DSN manually instead of using url.Parse #119

merged 1 commit into from
Mar 1, 2020

Conversation

kaorimatz
Copy link
Contributor

@kaorimatz kaorimatz commented Feb 29, 2020

Related issue

ory/keto#145

Proposed changes

Parse a DSN string manually instead of using url.Parse since a DSN string for MySQL is no longer always parsable with url.Parse after this change (Ref: golang/go#33646).

$ cat <<EOF > main.go
package main

import (
        "fmt"
        "net/url"
)

func main() {
        fmt.Println(url.Parse("mysql://tcp(127.0.0.1:3306)/"))
}
EOF
$ go version
go version go1.14 darwin/amd64
$ go run main.go
<nil> parse "mysql://tcp(127.0.0.1:3306)/": invalid port ":3306)" after host

Checklist

  • I have read the contributing guidelines
  • I have read the security policy
  • I confirm that this pull request does not address a security vulnerability. If this pull request addresses a security
    vulnerability, I confirm that I got green light (please contact security@ory.sh) from the maintainers to push the changes.
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation within the code base (if appropriate)

Further comments

I have only tested this with keto migrate sql.

@claassistantio
Copy link

claassistantio commented Feb 29, 2020

CLA assistant check
All committers have signed the CLA.

@kaorimatz kaorimatz changed the title fix(sqlcon): parse DSN manually instead of using url.Parse fix(sqlcon): Parse DSN manually instead of using url.Parse Feb 29, 2020
@aeneasr aeneasr merged commit f09f5c9 into ory:master Mar 1, 2020
@kaorimatz kaorimatz deleted the fix-sqlcon-parse-dsn-manually-instead-of-using-url-parse branch March 27, 2020 15:04
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