mirror of
https://github.com/restic/restic.git
synced 2024-12-21 23:33:03 +00:00
backend/azure: Handle Container SAS/SAT
Ignore AuthorizationFailure caused by using a container level SAS/SAT token when calling GetProperties during the Create() call. This is because the GetProperties call expects an Account Level token, and the container level token simply lacks the appropriate permissions. Supressing the Authorization Failure is OK, because if the token is actually invalid, this is caught elsewhere when we try to actually use the token to do work.
This commit is contained in:
parent
e3a022f9b5
commit
d6e76a22a8
1 changed files with 6 additions and 0 deletions
|
@ -160,6 +160,12 @@ func Create(ctx context.Context, cfg Config, rt http.RoundTripper) (*Backend, er
|
|||
if err != nil {
|
||||
return nil, errors.Wrap(err, "container.Create")
|
||||
}
|
||||
} else if err != nil && bloberror.HasCode(err, bloberror.AuthorizationFailure) {
|
||||
// We ignore this Auth. Failure, as the failure is related to the type
|
||||
// of SAS/SAT, not an actual real failure. If the token is invalid, we
|
||||
// fail later on anyway.
|
||||
// For details see Issue #4004.
|
||||
debug.Log("Ignoring AuthorizationFailure when calling GetProperties")
|
||||
} else if err != nil {
|
||||
return be, errors.Wrap(err, "container.GetProperties")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue