-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an RBS signature for sigv4 (#3152)
- Loading branch information
1 parent
9b7d84b
commit c038125
Showing
14 changed files
with
170 additions
and
13 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module Aws | ||
module Sigv4 | ||
module Errors | ||
class MissingCredentialsError < ArgumentError | ||
def initialize: (?String msg) -> void | ||
end | ||
|
||
class MissingRegionError < ArgumentError | ||
def initialize: (*untyped) -> void | ||
end | ||
end | ||
end | ||
end |
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,15 @@ | ||
module Aws | ||
module Sigv4 | ||
interface _Credentials | ||
def access_key_id: () -> String | ||
def secret_access_key: () -> String | ||
def session_token: () -> String? | ||
def set?: () -> bool | ||
end | ||
|
||
interface _CredentialsProvider | ||
def credentials: () -> _Credentials | ||
def set?: () -> bool | ||
end | ||
end | ||
end |
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,4 @@ | ||
dependencies: | ||
- name: tempfile | ||
- name: stringio | ||
- name: uri |
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,25 @@ | ||
module Aws | ||
module Sigv4 | ||
class Request | ||
def initialize: ( | ||
http_method: String, | ||
endpoint: String | URI::HTTP | URI::HTTPS, | ||
?headers: Hash[String, String], | ||
?body: String | IO | ||
) -> void | ||
| (?Hash[Symbol, untyped]) -> void | ||
|
||
def http_method=: (String http_method) -> void | ||
def http_method: () -> String | ||
|
||
def endpoint: () -> (URI::HTTP | URI::HTTPS) | ||
def endpoint=: (String | URI::HTTP | URI::HTTPS endpoint) -> void | ||
|
||
def headers=: (Hash[String, String] headers) -> void | ||
def headers: () -> Hash[String, String] | ||
|
||
def body=: (String | IO body) -> void | ||
def body: () -> (String | IO) | ||
end | ||
end | ||
end |
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,12 @@ | ||
module Aws | ||
module Sigv4 | ||
class Signature | ||
attr_accessor headers: Hash[String, String] | ||
attr_accessor canonical_request: String | ||
attr_accessor string_to_sign: String | ||
attr_accessor content_sha256: String | ||
attr_accessor signature: String | ||
attr_accessor extra: Hash[untyped, untyped] | ||
end | ||
end | ||
end |
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,51 @@ | ||
module Aws | ||
module Sigv4 | ||
class Signer | ||
def initialize: ( | ||
service: String, | ||
region: String, | ||
?access_key_id: String, | ||
?secret_access_key: String, | ||
?session_token: String, | ||
?credentials: _Credentials, | ||
?credentials_provider: _CredentialsProvider, | ||
?unsigned_headers: Array[String], | ||
?uri_escape_path: bool, | ||
?apply_checksum_header: bool, | ||
?signing_algorithm: :sigv4 | :sigv4a | :'sigv4-s3express', | ||
?omit_session_token: bool, | ||
?normalize_path: bool, | ||
) -> void | ||
| (?Hash[Symbol, untyped]) -> void | ||
|
||
attr_reader service: String | ||
attr_reader region: String | ||
attr_reader credentials_provider: _CredentialsProvider | ||
attr_reader unsigned_headers: Array[String] | ||
attr_reader apply_checksum_header: bool | ||
|
||
def sign_request: ( | ||
http_method: String, | ||
url: String | URI::HTTPS | URI::HTTP, | ||
?headers: Hash[String, String], | ||
?body: String | IO | StringIO | Tempfile, | ||
) -> Signature | ||
|
||
def sign_event: ( | ||
String, | ||
String, | ||
untyped | ||
) -> [Hash[String, untyped], String] | ||
|
||
def presign_url: ( | ||
http_method: String, | ||
url: String | URI::HTTP | URI::HTTPS, | ||
?headers: Hash[String, String], | ||
?expires_in: Integer, | ||
?body: String | IO, | ||
?body_digest: String, | ||
?time: Time, | ||
) -> (URI::HTTP | URI::HTTPS) | ||
end | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
sources: | ||
- type: git | ||
name: ruby/gem_rbs_collection | ||
remote: https://github.com/ruby/gem_rbs_collection.git | ||
revision: main | ||
repo_dir: gems | ||
|
||
path: .gem_rbs_collection | ||
|
||
gems: | ||
- name: stringio | ||
ignore: false | ||
- name: tempfile | ||
ignore: false | ||
- name: uri | ||
ignore: false | ||
- name: addressable | ||
ignore: true | ||
- name: diff-lcs | ||
ignore: true | ||
- name: rake | ||
ignore: true | ||
- name: rbs | ||
ignore: true | ||
- name: rubocop | ||
ignore: true | ||
- name: webmock | ||
ignore: true | ||
- name: yard | ||
ignore: true |
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