Auth: Add CLI command to create access tokens for apps #782 #808 #3943

You can now run "photoprism auth add" to create new client access tokens
that allow external applications to use the built-in REST API.

Signed-off-by: Michael Mayer <michael@photoprism.app>
This commit is contained in:
Michael Mayer
2024-01-05 16:31:07 +01:00
parent d6ec8c069e
commit 713593da4e
117 changed files with 2528 additions and 938 deletions

View File

@@ -11,14 +11,14 @@ func TestGetShares(t *testing.T) {
t.Run("InvalidToken", func(t *testing.T) {
app, router, _ := NewApiTest()
Shares(router)
r := PerformRequest(app, "GET", "/api/v1/1jxf3jfn2k/st9lxuqxpogaaba7")
r := PerformRequest(app, "GET", "/api/v1/1jxf3jfn2k/ss6sg6bxpogaaba7")
assert.Equal(t, http.StatusTemporaryRedirect, r.Code)
})
//TODO Why does it panic?
/*t.Run("valid token and share", func(t *testing.T) {
app, router, _ := NewApiTest()
Shares(router)
r := PerformRequest(app, "GET", "/api/v1/4jxf3jfn2k/at9lxuqxpogaaba7")
r := PerformRequest(app, "GET", "/api/v1/4jxf3jfn2k/as6sg6bxpogaaba7")
assert.Equal(t, http.StatusTemporaryRedirect, r.Code)
})*/
t.Run("InvalidToken", func(t *testing.T) {