Bug 217924 - [results.webkit.org] Refresh S3 context when token expires
Summary: [results.webkit.org] Refresh S3 context when token expires
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-10-19 15:22 PDT by Jonathan Bedard
Modified: 2020-10-19 17:29 PDT (History)
5 users (show)

See Also:


Attachments
Patch (2.10 KB, patch)
2020-10-19 15:30 PDT, Jonathan Bedard
dewei_zhu: review+
Details | Formatted Diff | Diff
Patch (2.20 KB, patch)
2020-10-19 16:33 PDT, Jonathan Bedard
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Bedard 2020-10-19 15:22:37 PDT
S3 access tokens may expire, we need to refresh the S3 context when we detect that the authentication provider has changed the access token.
Comment 1 Jonathan Bedard 2020-10-19 15:23:11 PDT
<rdar://problem/70387457>
Comment 2 Jonathan Bedard 2020-10-19 15:30:17 PDT
Created attachment 411806 [details]
Patch
Comment 3 dewei_zhu 2020-10-19 15:41:34 PDT
Comment on attachment 411806 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=411806&action=review

> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/model/s3_archiver.py:92
> +        if self._cached_token != self.credentials.aws_session_token:

Maybe adding a null check here or assert on constructor to make sure self.credentials is not None?
Comment 4 Jonathan Bedard 2020-10-19 15:52:28 PDT
Comment on attachment 411806 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=411806&action=review

>> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/model/s3_archiver.py:92
>> +        if self._cached_token != self.credentials.aws_session_token:
> 
> Maybe adding a null check here or assert on constructor to make sure self.credentials is not None?

I can put this check in the __init__, because (although the review hides it), line 63 will raise an exception first.
Comment 5 Jonathan Bedard 2020-10-19 16:33:32 PDT
Created attachment 411811 [details]
Patch
Comment 6 dewei_zhu 2020-10-19 16:42:27 PDT
Comment on attachment 411806 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=411806&action=review

>>> Tools/Scripts/libraries/resultsdbpy/resultsdbpy/model/s3_archiver.py:92
>>> +        if self._cached_token != self.credentials.aws_session_token:
>> 
>> Maybe adding a null check here or assert on constructor to make sure self.credentials is not None?
> 
> I can put this check in the __init__, because (although the review hides it), line 63 will raise an exception first.

Got it.
Comment 7 dewei_zhu 2020-10-19 16:42:56 PDT
r=me
Comment 8 EWS 2020-10-19 17:29:53 PDT
Committed r268702: <https://trac.webkit.org/changeset/268702>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 411811 [details].