oclib + perms naming

This commit is contained in:
mr
2024-11-21 11:07:19 +01:00
parent 9a86604564
commit be071ec328
5 changed files with 41 additions and 11 deletions

View File

@@ -22,7 +22,7 @@ func (h HydraClaims) generateKey(relation string, path string) (string, error) {
return "", err
}
p := strings.ReplaceAll(strings.ToUpper(path), "/", "_")
return strings.ToLower(method.String()) + "_" + strings.ReplaceAll(p, ":", ""), nil
return strings.ToUpper(method.String()) + "_" + strings.ReplaceAll(p, ":", ""), nil
}
// decode key expect to extract method and path from key
@@ -38,7 +38,7 @@ func (h HydraClaims) decodeKey(key string, external bool) (tools.METHOD, string,
if err != nil {
return meth, "", err
}
p := strings.ReplaceAll(strings.ToLower(s[1]), "_", "/")
p := strings.ReplaceAll(strings.ToUpper(s[1]), "_", "/")
return meth, p, nil
}