-
Notifications
You must be signed in to change notification settings - Fork 41
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
Initial oauth implementation #122
Conversation
2778c0b
to
ef1d700
Compare
Hi @rcypher-databricks this would be a great feature. I see it's still in draft. Curious if it's close to merge? |
Hi Scott, the plan is to get back to oauth next week. So hopefully in the next 2 weeks we'll get something released |
ef1d700
to
daab5bb
Compare
} | ||
} else { | ||
if !hasScope(scopes, "sql") { | ||
scopes = append(scopes, "sql") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we use sql or all-apis? Gotta check with Bryan Mcquade
examples/oauth/main.go
Outdated
connector, err := dbsql.NewConnector( | ||
dbsql.WithServerHostname(os.Getenv("DATABRICKS_HOST")), | ||
dbsql.WithHTTPPath(os.Getenv("DATABRICKS_HTTPPATH")), | ||
dbsql.WithDefaultOAUTH(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OAUTH is Oauth
internal/config/config.go
Outdated
@@ -14,7 +14,8 @@ import ( | |||
|
|||
"github.com/databricks/databricks-sql-go/auth" | |||
"github.com/databricks/databricks-sql-go/auth/noop" | |||
"github.com/databricks/databricks-sql-go/auth/pat" | |||
"github.com/databricks/databricks-sql-go/internal/auth/oauth/defauth" | |||
"github.com/databricks/databricks-sql-go/internal/auth/pat" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a breaking change!
Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
Fixed error in default authenticator where it tried to register the same http handler multiple times. Added config decorator functions WithDefaultOAUTH, WithClientCredentials Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
Moved implementation out of internal. Allow specifying auth type and parameters in dsn string. Refactored dsn parsing. Added tests to dsn parsing. Change default authenticator back to Noop Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
d5a2292
to
5579ce8
Compare
Updated doc.go with new dsn parameters and connector functions. Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
Signed-off-by: Raymond Cypher <raymond.cypher@databricks.com>
Oauth implementation.
Added m2m authenticator.
Added basic u2m authenticator. Implementation is broken out into public functions that clients can use to implement their own authenticator.
Allow specifying auth type and parameters in dsn.