forked from TrueCloudLab/rclone
vendor: update github.com/ncw/swift to bring in Expires changes
This commit is contained in:
parent
bb80586473
commit
595fea757d
9 changed files with 55 additions and 13 deletions
16
vendor/github.com/ncw/swift/auth_v3.go
generated
vendored
16
vendor/github.com/ncw/swift/auth_v3.go
generated
vendored
|
@ -6,6 +6,7 @@ import (
|
|||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -76,9 +77,10 @@ type v3AuthApplicationCredential struct {
|
|||
// V3 Authentication response
|
||||
type v3AuthResponse struct {
|
||||
Token struct {
|
||||
Expires_At, Issued_At string
|
||||
Methods []string
|
||||
Roles []struct {
|
||||
ExpiresAt string `json:"expires_at"`
|
||||
IssuedAt string `json:"issued_at"`
|
||||
Methods []string
|
||||
Roles []struct {
|
||||
Id, Name string
|
||||
Links struct {
|
||||
Self string
|
||||
|
@ -285,6 +287,14 @@ func (auth *v3Auth) Token() string {
|
|||
return auth.Headers.Get("X-Subject-Token")
|
||||
}
|
||||
|
||||
func (auth *v3Auth) Expires() time.Time {
|
||||
t, err := time.Parse(time.RFC3339, auth.Auth.Token.ExpiresAt)
|
||||
if err != nil {
|
||||
return time.Time{} // return Zero if not parsed
|
||||
}
|
||||
return t
|
||||
}
|
||||
|
||||
func (auth *v3Auth) CdnUrl() string {
|
||||
return ""
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue