Skip to content
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
3 changes: 3 additions & 0 deletions sig/cognito_idp.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module CognitoIdp
VERSION: String
end
25 changes: 25 additions & 0 deletions sig/cognito_idp/authorization_uri.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
module CognitoIdp
class AuthorizationUri
attr_reader client_id: String
attr_reader code_challenge_method: String?
attr_reader code_challenge: String?
attr_reader domain: String
attr_reader idp_identifier: String?
attr_reader identity_provider: String?
attr_reader nonce: String?
attr_reader redirect_uri: String
attr_reader response_type: Symbol
attr_reader scope: String | Array[String] | nil
attr_reader state: String?

def initialize: (client_id: String, domain: String, redirect_uri: String, ?response_type: Symbol, **untyped) -> void

def to_s: () -> String

private

def params: () -> Hash[Symbol, untyped]

def scope_string: () -> String?
end
end
32 changes: 29 additions & 3 deletions sig/cognito_idp/client.rbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,32 @@
module CognitoIdp
module Client
VERSION: String
# See the writing guide of rbs: https://github.com/ruby/rbs#guides
class Client
attr_reader adapter: Symbol
attr_reader client_id: String
attr_reader client_secret: String?
attr_reader domain: String

def initialize: (client_id: String, domain: String, ?client_secret: String?, ?adapter: Symbol, ?stubs: untyped) -> void

def inspect: () -> String

def authorization_uri: (redirect_uri: String, **untyped) -> String

def get_token: (grant_type: String | Symbol, **untyped) -> Token
| (grant_type: String | Symbol, **untyped) { (Token) -> void } -> Token

def get_user_info: (Token | String) -> UserInfo
| (Token | String) { (UserInfo) -> void } -> UserInfo

def revoke_token: (Token | String) -> void

def logout_uri: (**untyped) -> String

private

def connection: () -> untyped

def handle_error_response: (untyped) -> void

def basic_authorization_headers: () -> Hash[String, String]?
end
end
13 changes: 13 additions & 0 deletions sig/cognito_idp/error.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module CognitoIdp
class Error < StandardError
attr_reader error: String
attr_reader error_description: String?
attr_reader http_status: Integer?

def initialize: (error: String, ?error_description: String?, ?http_status: Integer?) -> void

private

def build_message: () -> String
end
end
21 changes: 21 additions & 0 deletions sig/cognito_idp/logout_uri.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module CognitoIdp
class LogoutUri
attr_reader client_id: String
attr_reader domain: String
attr_reader logout_uri: String?
attr_reader redirect_uri: String?
attr_reader response_type: Symbol?
attr_reader scope: String | Array[String] | nil
attr_reader state: String?

def initialize: (client_id: String, domain: String, **untyped) -> void

def to_s: () -> String

private

def params: () -> Hash[Symbol, untyped]

def scope_string: () -> String?
end
end
16 changes: 16 additions & 0 deletions sig/cognito_idp/token.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module CognitoIdp
class Token
attr_reader access_token: String?
attr_reader id_token: String?
attr_reader token_type: String?
attr_reader expires_at: Time?
attr_reader expires_in: Integer?
attr_reader refresh_token: String?

def initialize: (Hash[String | Symbol, untyped]) -> void

def expired?: () -> bool

def inspect: () -> String
end
end
11 changes: 11 additions & 0 deletions sig/cognito_idp/user_info.rbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module CognitoIdp
class UserInfo
def initialize: (Hash[String | Symbol, untyped]) -> void

private

def method_missing: (Symbol, *untyped) -> untyped

def respond_to_missing?: (Symbol, ?bool) -> bool
end
end