forked from dapr/components-contrib
-
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.
Ft/sasl scram sha 256 512 (dapr#1856)
* working with hardcoded SHA-512 Signed-off-by: Andrew Duss <[email protected]> * cleanup code Signed-off-by: Andrew Duss <[email protected]> * Do not hardcode specific testTopicName Signed-off-by: ItalyPaleAle <[email protected]> Signed-off-by: Andrew Duss <[email protected]> * Ensure context propagation in MySQL binding (dapr#1829) Spin-off from PR adding contexts to input bindings Signed-off-by: ItalyPaleAle <[email protected]> Co-authored-by: Dapr Bot <[email protected]> Signed-off-by: Andrew Duss <[email protected]> * Add support for AAD auth in Azure Storage Queues binding (dapr#1842) * Add support for AAD auth in Azure Storage Queues binding Signed-off-by: ItalyPaleAle <[email protected]> * 🧹 Signed-off-by: ItalyPaleAle <[email protected]> Co-authored-by: Bernd Verst <[email protected]> Signed-off-by: Andrew Duss <[email protected]> * Moved authentication to be an internal pkg (dapr#1855) Signed-off-by: ItalyPaleAle <[email protected]> Signed-off-by: Andrew Duss <[email protected]> * Azure AD support in SignalR (dapr#1852) * WIP: Azure AD support in SignalR Signed-off-by: ItalyPaleAle <[email protected]> * Correct SignalR AAD details Signed-off-by: ItalyPaleAle <[email protected]> * Misc fixes Signed-off-by: ItalyPaleAle <[email protected]> * azauth package name Signed-off-by: ItalyPaleAle <[email protected]> Signed-off-by: Andrew Duss <[email protected]> * rename SCRAM properly as SASL Signed-off-by: Andrew Duss <[email protected]> * update gomod/sum Signed-off-by: Andrew Duss <[email protected]> * gofmt Signed-off-by: Andrew Duss <[email protected]> * mod tidy Signed-off-by: Andrew Duss <[email protected]> * goval Signed-off-by: Andrew Duss <[email protected]> * use xdg-go instead of depreicated xdg library Signed-off-by: Andrew Duss <[email protected]> Co-authored-by: ItalyPaleAle <[email protected]> Co-authored-by: Dapr Bot <[email protected]> Co-authored-by: Bernd Verst <[email protected]> Co-authored-by: Yaron Schneider <[email protected]> Signed-off-by: Andrew Duss <[email protected]>
- Loading branch information
1 parent
cfb6511
commit 46f0113
Showing
9 changed files
with
88 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
Copyright 2022 The Dapr Authors | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package kafka | ||
|
||
import ( | ||
"crypto/sha256" | ||
"crypto/sha512" | ||
|
||
"github.com/xdg-go/scram" | ||
) | ||
|
||
var ( | ||
SHA256 scram.HashGeneratorFcn = sha256.New | ||
SHA512 scram.HashGeneratorFcn = sha512.New | ||
) | ||
|
||
type XDGSCRAMClient struct { | ||
*scram.Client | ||
*scram.ClientConversation | ||
scram.HashGeneratorFcn | ||
} | ||
|
||
func (x *XDGSCRAMClient) Begin(userName, password, authzID string) (err error) { | ||
x.Client, err = x.HashGeneratorFcn.NewClient(userName, password, authzID) | ||
if err != nil { | ||
return err | ||
} | ||
x.ClientConversation = x.Client.NewConversation() | ||
return nil | ||
} | ||
|
||
func (x *XDGSCRAMClient) Step(challenge string) (response string, err error) { | ||
response, err = x.ClientConversation.Step(challenge) | ||
return | ||
} | ||
|
||
func (x *XDGSCRAMClient) Done() bool { | ||
return x.ClientConversation.Done() | ||
} |
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