forked from TrueCloudLab/frostfs-node
[#528] objectcore: Validate token issuer
Add token issuer against object owner validation. Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
4ea0df77d0
commit
ab2614ec2d
2 changed files with 36 additions and 1 deletions
|
@ -153,9 +153,14 @@ func (v *FormatValidator) validateSignatureKey(obj *objectSDK.Object) error {
|
|||
}
|
||||
|
||||
token := obj.SessionToken()
|
||||
ownerID := *obj.OwnerID()
|
||||
|
||||
if token == nil || !token.AssertAuthKey(&key) {
|
||||
return v.checkOwnerKey(*obj.OwnerID(), key)
|
||||
return v.checkOwnerKey(ownerID, key)
|
||||
}
|
||||
|
||||
if !token.Issuer().Equals(ownerID) {
|
||||
return fmt.Errorf("(%T) different token issuer and object owner identifiers %s/%s", v, token.Issuer(), ownerID)
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue