forked from gravitational/teleport
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable credential provider authentication for self-hosted mysql DB
refactored New function to NewClient using opentelemetry http wrapper and using http client's in-built timeout Addressed some of the review comments Renamed token, tokenConfig, tokenClient to tokensource, tokenSourceConfig, tokenSourceClient Using go-resty instead of default http client AuthInjector can inject more types of authentications like mTLS Added default values and corresponding tests for token source config Addressed some of the review comments Calling CheckAndSetDefaults in NewClient Moved url substitution to a new function deleted old file
- Loading branch information
1 parent
9f946de
commit 0422d61
Showing
14 changed files
with
445 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package tokensource | ||
|
||
import ( | ||
"github.com/go-resty/resty/v2" | ||
) | ||
|
||
const ( | ||
NoneAuthScheme = "NONE" | ||
) | ||
|
||
const DefaultAuthScheme = NoneAuthScheme | ||
|
||
type AuthCreator func(config AuthConfig) AuthInjector | ||
|
||
var AuthCreators = make(map[string]AuthCreator) | ||
|
||
func init() { | ||
AuthCreators[NoneAuthScheme] = newNoAuthInjector | ||
} | ||
|
||
type AuthInjector interface { | ||
injectAuth(c *resty.Client) | ||
} | ||
|
||
type NoAuthInjector struct { | ||
} | ||
|
||
func (i NoAuthInjector) injectAuth(c *resty.Client) { | ||
} | ||
|
||
func newNoAuthInjector(config AuthConfig) AuthInjector { | ||
return NoAuthInjector{} | ||
} |
Oops, something went wrong.