1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package vault
import (
"context"
"errors"
"time"
)
const (
CapabilityAtprotoSession = "vault.atproto.session"
AtprotoSessionClient = "atproto-session-proxy"
AtprotoSessionActive = "active"
)
var (
ErrNoAtprotoSession = errors.New("vault: the atproto auth mount holds no session for the DID")
ErrAtprotoSessionInactive = errors.New("vault: the atproto session is not active")
)
type AtprotoSession struct {
DID string
Handle string
PDS string
Scope string
Status string
StatusReason string
ExpiresAt time.Time
}
type AtprotoProof struct {
AccessToken string
DPoP string
}
type AtprotoSessions interface {
Session(ctx context.Context, mount, path string) (AtprotoSession, error)
Proof(ctx context.Context, mount, path, method, target, nonce string) (AtprotoProof, error)
}