Skip to content

Commit

Permalink
Merge pull request #489 from weaviate/remove_offline_scope
Browse files Browse the repository at this point in the history
Remove default offline scope from OIDC user+pw
  • Loading branch information
dirkkul committed Sep 7, 2023
2 parents d383f04 + a4ddbdc commit 043f5bb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion integration/test_authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ def test_authentication_client_credentials(
"some_scope offline_access",
False,
),
("okta - default scope", "test@test.de", "OKTA_DUMMY_CI_PW", OKTA_PORT_USERS, None, False),
(
"okta - no refresh",
"test@test.de",
Expand Down
3 changes: 1 addition & 2 deletions mock_tests/test_auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ def test_user_password(weaviate_auth_mock):

user = "AUsername"
pw = "SomePassWord"
scopes = "offline_access"

# note: order matters. If this handler is not called, check of the order of arguments changed
weaviate_auth_mock.expect_request(
"/auth",
data=f"grant_type=password&username={user}&password={pw}&scope={scopes}&client_id={CLIENT_ID}",
data=f"grant_type=password&username={user}&password={pw}&client_id={CLIENT_ID}",
).respond_with_json(
{"access_token": ACCESS_TOKEN, "expires_in": 500, "refresh_token": REFRESH_TOKEN}
)
Expand Down
4 changes: 2 additions & 2 deletions weaviate/auth.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Authentication class definitions.
"""
from dataclasses import dataclass, field
from dataclasses import dataclass
from typing import Optional, Union, List

from weaviate.warnings import _Warnings
Expand Down Expand Up @@ -46,7 +46,7 @@ class AuthClientPassword:

username: str
password: str
scope: Optional[SCOPES] = field(default_factory=lambda: ["offline_access"])
scope: Optional[SCOPES] = None

def __post_init__(self) -> None:
if self.scope is None:
Expand Down

0 comments on commit 043f5bb

Please sign in to comment.