-
-
Notifications
You must be signed in to change notification settings - Fork 361
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use google/go-cloud to fetch rules and credentials from object …
…storage (#562) Closes #518 As proposed in #518, I've used go-cloud library to fetch credentials and rules files from an object storage (S3, Azure Blob Storage or GCS).
- Loading branch information
Showing
19 changed files
with
1,457 additions
and
170 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
120 changes: 120 additions & 0 deletions
120
...als/testdata/TestFetcherDefault/name=should_fetch_from_azure_object_storage-azblob.replay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
{ | ||
"Initial": "AQAAAA7XLQcUD9nUsAA8", | ||
"Version": "0.2", | ||
"Converter": { | ||
"ClearHeaders": [ | ||
"^X-Goog-.*Encryption-Key$", | ||
"^X-Ms-Date$", | ||
"^User-Agent$" | ||
], | ||
"RemoveRequestHeaders": [ | ||
"^Authorization$", | ||
"^Proxy-Authorization$", | ||
"^Connection$", | ||
"^Content-Type$", | ||
"^Date$", | ||
"^Host$", | ||
"^Transfer-Encoding$", | ||
"^Via$", | ||
"^X-Forwarded-.*$", | ||
"^X-Cloud-Trace-Context$", | ||
"^X-Goog-Api-Client$", | ||
"^X-Google-.*$", | ||
"^X-Gfe-.*$" | ||
], | ||
"RemoveResponseHeaders": [ | ||
"^X-Google-.*$", | ||
"^X-Gfe-.*$" | ||
], | ||
"ClearParams": null, | ||
"RemoveParams": [ | ||
"^se$", | ||
"^sig$", | ||
"^X-Ms-Date$" | ||
] | ||
}, | ||
"Entries": [ | ||
{ | ||
"ID": "1fb66968f4225198", | ||
"Request": { | ||
"Method": "GET", | ||
"URL": "https://oathkeepertestbucket.blob.core.windows.net/path/prefix/jwks.json", | ||
"Header": { | ||
"Accept-Encoding": [ | ||
"gzip" | ||
], | ||
"User-Agent": [ | ||
"CLEARED" | ||
], | ||
"X-Ms-Date": [ | ||
"CLEARED" | ||
], | ||
"X-Ms-Version": [ | ||
"2018-11-09" | ||
] | ||
}, | ||
"MediaType": "", | ||
"BodyParts": [ | ||
"" | ||
] | ||
}, | ||
"Response": { | ||
"StatusCode": 200, | ||
"Proto": "HTTP/1.1", | ||
"ProtoMajor": 1, | ||
"ProtoMinor": 1, | ||
"Header": { | ||
"Accept-Ranges": [ | ||
"bytes" | ||
], | ||
"Content-Disposition": [ | ||
"" | ||
], | ||
"Content-Length": [ | ||
"1811" | ||
], | ||
"Content-Md5": [ | ||
"Yu3yvund6SMtT06kBFdUjw==" | ||
], | ||
"Content-Type": [ | ||
"application/json" | ||
], | ||
"Date": [ | ||
"Thu, 29 Oct 2020 18:55:17 GMT" | ||
], | ||
"Etag": [ | ||
"\"0x8D87C392EBEBAD7\"" | ||
], | ||
"Last-Modified": [ | ||
"Thu, 29 Oct 2020 18:33:51 GMT" | ||
], | ||
"Server": [ | ||
"Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0" | ||
], | ||
"X-Ms-Blob-Type": [ | ||
"BlockBlob" | ||
], | ||
"X-Ms-Creation-Time": [ | ||
"Thu, 29 Oct 2020 18:33:51 GMT" | ||
], | ||
"X-Ms-Lease-State": [ | ||
"available" | ||
], | ||
"X-Ms-Lease-Status": [ | ||
"unlocked" | ||
], | ||
"X-Ms-Request-Id": [ | ||
"bf519152-b01e-0093-7f25-ae09a5000000" | ||
], | ||
"X-Ms-Server-Encrypted": [ | ||
"true" | ||
], | ||
"X-Ms-Version": [ | ||
"2018-11-09" | ||
] | ||
}, | ||
"Body": "ewogICJrZXlzIjogWwogICAgewogICAgICAiYWxnIjogIlJTMjU2Iiw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BaWndKRGxYMGF1bmpsSjRVNmFyY0xpZEdhZWR6UE5BNmsyanh4REJaczdRbzVhaWRaM0JIYVFsWlFUOExJX0FjSGdEUl94NEV4RXhZTDlIU1I0bWlZZkgzQm54SDRVM0tLQVNMYVplOWl6NzI0cmpvbXlWY2xGTFdfR0NBS25DNkhLRHhWLUlVbEFHWU9SSDBoUSIKICAgIH0KICBdCn0=" | ||
} | ||
} | ||
] | ||
} |
117 changes: 117 additions & 0 deletions
117
credentials/testdata/TestFetcherDefault/name=should_fetch_from_gs_object_storage-gs.replay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
{ | ||
"Initial": "AQAAAA7XLQYEIQ6ZyAA8", | ||
"Version": "0.2", | ||
"Converter": { | ||
"ClearHeaders": [ | ||
"^X-Goog-.*Encryption-Key$", | ||
"^Expires$", | ||
"^Signature$" | ||
], | ||
"RemoveRequestHeaders": [ | ||
"^Authorization$", | ||
"^Proxy-Authorization$", | ||
"^Connection$", | ||
"^Content-Type$", | ||
"^Date$", | ||
"^Host$", | ||
"^Transfer-Encoding$", | ||
"^Via$", | ||
"^X-Forwarded-.*$", | ||
"^X-Cloud-Trace-Context$", | ||
"^X-Goog-Api-Client$", | ||
"^X-Google-.*$", | ||
"^X-Gfe-.*$" | ||
], | ||
"RemoveResponseHeaders": [ | ||
"^X-Google-.*$", | ||
"^X-Gfe-.*$" | ||
], | ||
"ClearParams": [ | ||
"^Expires$", | ||
"^Signature$" | ||
], | ||
"RemoveParams": null | ||
}, | ||
"Entries": [ | ||
{ | ||
"ID": "17621eb301ff5978", | ||
"Request": { | ||
"Method": "GET", | ||
"URL": "https://storage.googleapis.com/oathkeeper-test-bucket/path/prefix/jwks.json", | ||
"Header": { | ||
"Accept-Encoding": [ | ||
"gzip" | ||
], | ||
"User-Agent": [ | ||
"go-cloud/blob/0.1.0" | ||
] | ||
}, | ||
"MediaType": "", | ||
"BodyParts": [ | ||
"" | ||
] | ||
}, | ||
"Response": { | ||
"StatusCode": 200, | ||
"Proto": "HTTP/1.1", | ||
"ProtoMajor": 1, | ||
"ProtoMinor": 1, | ||
"Header": { | ||
"Accept-Ranges": [ | ||
"bytes" | ||
], | ||
"Alt-Svc": [ | ||
"h3-Q050=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000,h3-T051=\":443\"; ma=2592000,h3-T050=\":443\"; ma=2592000,h3-Q046=\":443\"; ma=2592000,h3-Q043=\":443\"; ma=2592000,quic=\":443\"; ma=2592000; v=\"46,43\"" | ||
], | ||
"Cache-Control": [ | ||
"private, max-age=0" | ||
], | ||
"Content-Length": [ | ||
"1811" | ||
], | ||
"Content-Type": [ | ||
"application/json" | ||
], | ||
"Date": [ | ||
"Thu, 29 Oct 2020 18:50:45 GMT" | ||
], | ||
"Etag": [ | ||
"\"62edf2bee9dde9232d4f4ea40457548f\"" | ||
], | ||
"Expires": [ | ||
"CLEARED" | ||
], | ||
"Last-Modified": [ | ||
"Thu, 29 Oct 2020 17:18:55 GMT" | ||
], | ||
"Server": [ | ||
"UploadServer" | ||
], | ||
"X-Goog-Generation": [ | ||
"1603991935010126" | ||
], | ||
"X-Goog-Hash": [ | ||
"crc32c=l52Lxg==", | ||
"md5=Yu3yvund6SMtT06kBFdUjw==" | ||
], | ||
"X-Goog-Metageneration": [ | ||
"1" | ||
], | ||
"X-Goog-Storage-Class": [ | ||
"STANDARD" | ||
], | ||
"X-Goog-Stored-Content-Encoding": [ | ||
"identity" | ||
], | ||
"X-Goog-Stored-Content-Length": [ | ||
"1811" | ||
], | ||
"X-Guploader-Uploadid": [ | ||
"ABg5-UxYhQqahmJdafg-9J_c6Z3luhTgHnt2Dk9xHa6mOyh7OVlcTm4Zfyc7oHbBNDDRRWMwuo4nkZaWlHfAohthIOtzPDWxDw" | ||
] | ||
}, | ||
"Body": "ewogICJrZXlzIjogWw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