-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #859 from ydb-platform/obfuscate-access-token
* Refactored credentials options (from funcs to interfaces and types)
- Loading branch information
Showing
15 changed files
with
412 additions
and
140 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package credentials | ||
|
||
import ( | ||
"google.golang.org/grpc" | ||
|
||
"github.com/ydb-platform/ydb-go-sdk/v3/internal/credentials" | ||
) | ||
|
||
// WithSourceInfo option append to credentials object the source info for reporting source info details on error case | ||
func WithSourceInfo(sourceInfo string) credentials.SourceInfoOption { | ||
return credentials.WithSourceInfo(sourceInfo) | ||
} | ||
|
||
// WithGrpcDialOptions option append to static credentials object GRPC dial options | ||
func WithGrpcDialOptions(opts ...grpc.DialOption) credentials.StaticCredentialsOption { | ||
return credentials.WithGrpcDialOptions(opts...) | ||
} |
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 was deleted.
Oops, something went wrong.
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,20 @@ | ||
package credentials | ||
|
||
type SourceInfoOption string | ||
|
||
func (sourceInfo SourceInfoOption) ApplyStaticCredentialsOption(h *Static) { | ||
h.sourceInfo = string(sourceInfo) | ||
} | ||
|
||
func (sourceInfo SourceInfoOption) ApplyAnonymousCredentialsOption(h *Anonymous) { | ||
h.sourceInfo = string(sourceInfo) | ||
} | ||
|
||
func (sourceInfo SourceInfoOption) ApplyAccessTokenCredentialsOption(h *AccessToken) { | ||
h.sourceInfo = string(sourceInfo) | ||
} | ||
|
||
// WithSourceInfo option append to credentials object the source info for reporting source info details on error case | ||
func WithSourceInfo(sourceInfo string) SourceInfoOption { | ||
return SourceInfoOption(sourceInfo) | ||
} |
Oops, something went wrong.