mirror of
https://github.com/pikami/cosmium.git
synced 2025-12-19 17:00:37 +00:00
Fixed authentication key generation for partition key ranges
Fixed collection rid generation Improved compatibility with SDKs
This commit is contained in:
@@ -10,6 +10,11 @@ import (
|
||||
|
||||
// https://learn.microsoft.com/en-us/rest/api/cosmos-db/access-control-on-cosmosdb-resources
|
||||
func GenerateSignature(verb string, resourceType string, resourceId string, date string, masterKey string) string {
|
||||
isNameBased := resourceId != "" && ((len(resourceId) > 4 && resourceId[3] == '/') || strings.HasPrefix(strings.ToLower(resourceId), "interopusers"))
|
||||
if !isNameBased {
|
||||
resourceId = strings.ToLower(resourceId)
|
||||
}
|
||||
|
||||
payload := fmt.Sprintf(
|
||||
"%s\n%s\n%s\n%s\n%s\n",
|
||||
strings.ToLower(verb),
|
||||
|
||||
Reference in New Issue
Block a user