Skip to content

Commit

Permalink
Issue ref: OAuth 2.0 Credential Format for Delta Sharing Client delta…
Browse files Browse the repository at this point in the history
  • Loading branch information
dialberg committed Apr 14, 2023
1 parent c5cf51b commit a4060b6
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions python/delta_sharing/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def from_json(json) -> "DeltaSharingProfile":
bearer_token = json["bearerToken"],
expiration_time = json.get("expirationTime"),
)
else:
elif share_credentials_version == 2:
type = json["type"]
if type == "persistent_oauth2.0":
token_endpoint = json["token_endpoint"]
Expand Down Expand Up @@ -108,7 +108,15 @@ def from_json(json) -> "DeltaSharingProfile":
raise ValueError(
"The current release does not supports {type} type. "
"Please check type."
)
)
else:
raise ValueError(
"'shareCredentialsVersion' in the profile is "
f"{share_credentials_version} which is too new. "
f"The current release supports version {DeltaSharingProfile.CURRENT} and below. "
"Please upgrade to a newer release."
)



@dataclass(frozen=True)
Expand Down

0 comments on commit a4060b6

Please sign in to comment.