Documentation
¶
Overview ¶
Package direct is the native explorer's way to the servers: no portal. It logs in itself -- the system browser and a loopback listener, as a public client (go-authn/rp, RFC 8252) -- and calls each server's WebDAV with a token addressed to that server alone (RFC 8707). A browser page goes through the portal instead, and never links any of this.
Index ¶
Constants ¶
const LoginAgain = "native:login"
LoginAgain is what LoginURL returns: a native window has no page to go to; its host logs in again when told to navigate there.
const MaxBody = 16 << 20
MaxBody bounds one request body, kept to be sent again after a refresh: the explorer's upload pieces are 8 MiB.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct {
// contains filtered or unexported fields
}
Backend logs in once, keeps the refresh token in this process's memory only, and spends it one refresh at a time: a provider rotates a public client's refresh tokens and ends the login when one is spent twice.
func New ¶
New is a Backend over cfg. open shows a URL to the person: the system browser (rp.OpenBrowser).
func (*Backend) EnsureToken ¶
EnsureToken makes sure a current token for server is held.
type Config ¶
type Config struct {
Issuer string
ClientID string // a PUBLIC client: no secret (RFC 8252 §8.5)
Scopes []string
Servers []Server
}
Config is what the native explorer needs to reach servers on its own: where to log in, and the servers -- what a portal would know.
type Server ¶
type Server struct {
ID, Label string
DAVURL string // its WebDAV, over https
Resource string // RFC 8707: the audience of its oidc block
Scope string // for a provider that sets the audience from a scope
CAFile string // when its certificate is not publicly trusted
}
Server is one fileshare server's WebDAV.