Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove default offline scope from OIDC user+pw #489

Merged
merged 1 commit into from
Sep 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(
dirkkul marked this conversation as resolved.
Show resolved Hide resolved
{"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