Skip to content

Commit 8598ebc

Browse files
committed
feat: Add io.cozy.sharings in token exchange
Used in cozy-sharing provider
1 parent a45dc6c commit 8598ebc

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

web/auth/token_exchange.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ var tokenExchangeAllowedScopes = map[string]struct{}{
3434
"io.cozy.contacts": {},
3535
"io.cozy.contacts.groups": {},
3636
"io.cozy.apps": {},
37+
"io.cozy.sharings": {},
3738
}
3839

3940
type tokenExchangeRequest struct {

web/auth/token_exchange_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
func TestValidateTokenExchangeScope(t *testing.T) {
1010
assert.Error(t, validateTokenExchangeScope(""))
1111
assert.Error(t, validateTokenExchangeScope("io.cozy.unknown"))
12-
assert.Error(t, validateTokenExchangeScope("io.cozy.files\tio.cozy.contacts\tio.cozy.contacts.groups\tio.cozy.apps"))
12+
assert.Error(t, validateTokenExchangeScope("io.cozy.files\tio.cozy.contacts\tio.cozy.contacts.groups\tio.cozy.apps\tio.cozy.sharings"))
1313
assert.NoError(t, validateTokenExchangeScope("io.cozy.files"))
14-
assert.NoError(t, validateTokenExchangeScope("io.cozy.files io.cozy.contacts io.cozy.contacts.groups io.cozy.apps"))
14+
assert.NoError(t, validateTokenExchangeScope("io.cozy.files io.cozy.contacts io.cozy.contacts.groups io.cozy.apps io.cozy.sharings"))
1515
}

0 commit comments

Comments
 (0)