WebDAV sync support, access tokens, REST control endpoints (#10)
Implement complete WebDAV file serving compatible with various clients from Windows File Explorer to more specialized sync tools. The old control WebSocket has been updated to part-DAV, part REST API instead. Implemented user:pass BASIC auth. Added UI and backend for creating tokens that avoid the need to use actual username and password for requests from CLI or DAV.
This commit is contained in:
@@ -65,3 +65,20 @@ export async function getServerConfig() {
|
||||
const data = await Client.get('/api/config')
|
||||
return data as { name: string, public: boolean }
|
||||
}
|
||||
|
||||
export const url_tokens = '/api/tokens'
|
||||
|
||||
export async function listTokens() {
|
||||
const data = await Client.get(url_tokens)
|
||||
return data
|
||||
}
|
||||
|
||||
export async function createToken(name: string) {
|
||||
const data = await Client.post(url_tokens, { name })
|
||||
return data
|
||||
}
|
||||
|
||||
export async function deleteToken(tokenId: string) {
|
||||
const data = await Client.delete(`${url_tokens}/${tokenId}`)
|
||||
return data
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user