cognito_idp 0.2.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73a9f1c7bb9ed725f35658e0b089125a361fbffd5d173758dd740a6e93b205b5
4
- data.tar.gz: 72608701acb079b2b2c7e31db55eefd2f40662e7c7f9e293cd34b76af829c808
3
+ metadata.gz: 2a0542d8f6932dfe48a2201f58c34d426146e5f2fa4325791d3c2290eee95457
4
+ data.tar.gz: 9c2f55fc02674b9adfc272bd7a2a9b6f51f8a855996abba8050a7ca016decb60
5
5
  SHA512:
6
- metadata.gz: 8e0bc41343ca5ea94f72c2f1c46253be9b029f27ba162621fc9b4fe1ff9325c796f2079ec64eada55792059621e001e521f88f3b3f72fb993568a17bc24782a3
7
- data.tar.gz: bb1f296f9e860c1ef871ddea30927d1d865812860d58650f36adb9a81a5086fc2134573ae03229581c4eeb6825ca69970325da6f00c956404286386608587d9f
6
+ metadata.gz: 772766ba67bd2fc1e1c74aa9f0f35e5e26396b0edc144fa427fce85609aff2548f28a33b1ce72d25cfc53c8f5277f2fdb3e024695cc8aa8705973ea201072113
7
+ data.tar.gz: 38d82779c5724c35ba03cae5a45d7b79ee5c51dac6a6c751cb9032fd8750bb48ff51c19b116d9f5fde72198c4ccbe92e0be951cd20af746f00671072765035db
data/CHANGELOG.md CHANGED
@@ -1,29 +1,55 @@
1
- # Changelog
2
1
 
3
- ## [0.2.0](https://github.com/appercept/cognito_idp-ruby/tree/0.2.0) (2025-11-19)
2
+ <a name="1.0.0"></a>
3
+ ## [1.0.0](https://github.com/appercept/cognito_idp-ruby/compare/v0.2.0...1.0.0)
4
4
 
5
- [Full Changelog](https://github.com/appercept/cognito_idp-ruby/compare/v0.1.1...0.2.0)
5
+ > 2026-03-03
6
6
 
7
- **Merged pull requests:**
7
+ ### Feat
8
8
 
9
- - feat: Add CognitoIdp::Token\#refresh\_token [\#3](https://github.com/appercept/cognito_idp-ruby/pull/3) ([rhatherall](https://github.com/rhatherall))
9
+ * Add token revocation support
10
+ * Add Token#expired? convenience method
10
11
 
11
- ## [v0.1.1](https://github.com/appercept/cognito_idp-ruby/tree/v0.1.1) (2023-12-07)
12
+ ### Fix
12
13
 
13
- [Full Changelog](https://github.com/appercept/cognito_idp-ruby/compare/v0.1.0...v0.1.1)
14
+ * Correct logout_uri test calling wrong method
15
+ * Tighten UserInfo and attr mutability
16
+ * Redact secrets and tokens from #inspect
17
+ * Use standard Base64 encoding for Basic Auth (RFC 7617)
18
+ * Raise Error on non-2xx responses
14
19
 
15
- **Fixed bugs:**
20
+ ### BREAKING CHANGE
16
21
 
17
- - NoMethodError: undefined method `key?' for OpenStruct [\#1](https://github.com/appercept/cognito_idp-ruby/issues/1)
18
22
 
19
- **Merged pull requests:**
23
+ Methods now raise CognitoIdp::Error instead of
24
+ returning nil on error responses.
20
25
 
21
- - fix: UserInfo always responds to missing [\#2](https://github.com/appercept/cognito_idp-ruby/pull/2) ([rhatherall](https://github.com/rhatherall))
22
26
 
23
- ## [v0.1.0](https://github.com/appercept/cognito_idp-ruby/tree/v0.1.0) (2023-12-02)
27
+ <a name="v0.2.0"></a>
28
+ ## [v0.2.0](https://github.com/appercept/cognito_idp-ruby/compare/v0.1.1...v0.2.0)
24
29
 
25
- [Full Changelog](https://github.com/appercept/cognito_idp-ruby/compare/6a859f5b15c9989aded52c92af8b99197ec5860d...v0.1.0)
30
+ > 2025-11-19
26
31
 
32
+ ### Feat
27
33
 
34
+ * Add CognitoIdp::Token#refresh_token
35
+
36
+ ### Fix
37
+
38
+ * Add `base64` dependency
39
+
40
+
41
+ <a name="v0.1.1"></a>
42
+ ## [v0.1.1](https://github.com/appercept/cognito_idp-ruby/compare/v0.1.0...v0.1.1)
43
+
44
+ > 2023-12-07
45
+
46
+ ### Fix
47
+
48
+ * UserInfo always responds to missing
49
+
50
+
51
+ <a name="v0.1.0"></a>
52
+ ## v0.1.0
53
+
54
+ > 2023-12-02
28
55
 
29
- \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/README.md CHANGED
@@ -14,7 +14,125 @@ If bundler is not being used to manage dependencies, install the gem by executin
14
14
 
15
15
  ## Usage
16
16
 
17
- TODO: Write usage instructions here
17
+ ### Client setup
18
+
19
+ ```ruby
20
+ client = CognitoIdp::Client.new(
21
+ client_id: "your_client_id",
22
+ domain: "your-domain.auth.eu-west-1.amazoncognito.com",
23
+ client_secret: "your_client_secret" # optional, depends on app client config
24
+ )
25
+ ```
26
+
27
+ ### Authorization URI
28
+
29
+ Build a URL to redirect users to the Cognito hosted UI:
30
+
31
+ ```ruby
32
+ url = client.authorization_uri(
33
+ redirect_uri: "https://example.com/auth/callback",
34
+ scope: %w[openid email profile],
35
+ state: SecureRandom.hex
36
+ )
37
+ ```
38
+
39
+ PKCE is supported via `code_challenge` and `code_challenge_method`:
40
+
41
+ ```ruby
42
+ url = client.authorization_uri(
43
+ redirect_uri: "https://example.com/auth/callback",
44
+ code_challenge: challenge,
45
+ code_challenge_method: "S256"
46
+ )
47
+ ```
48
+
49
+ ### Exchanging an authorization code for tokens
50
+
51
+ ```ruby
52
+ token = client.get_token(
53
+ grant_type: "authorization_code",
54
+ code: params[:code],
55
+ redirect_uri: "https://example.com/auth/callback"
56
+ )
57
+
58
+ token.access_token # => "eyJra..."
59
+ token.id_token # => "eyJra..."
60
+ token.refresh_token # => "eyJjd..."
61
+ token.expires_in # => 3600
62
+ token.expired? # => false
63
+ ```
64
+
65
+ With PKCE, pass the `code_verifier`:
66
+
67
+ ```ruby
68
+ token = client.get_token(
69
+ grant_type: "authorization_code",
70
+ code: params[:code],
71
+ redirect_uri: "https://example.com/auth/callback",
72
+ code_verifier: stored_verifier
73
+ )
74
+ ```
75
+
76
+ ### Client credentials
77
+
78
+ ```ruby
79
+ token = client.get_token(
80
+ grant_type: "client_credentials",
81
+ scope: "https://api.example.com/orders.read"
82
+ )
83
+ ```
84
+
85
+ ### Refreshing tokens
86
+
87
+ ```ruby
88
+ token = client.get_token(
89
+ grant_type: "refresh_token",
90
+ refresh_token: token.refresh_token
91
+ )
92
+ ```
93
+
94
+ ### User info
95
+
96
+ Accepts an access token string or a `Token` object:
97
+
98
+ ```ruby
99
+ user_info = client.get_user_info(token)
100
+
101
+ user_info.sub # => "248289761001"
102
+ user_info.email # => "janedoe@example.com"
103
+ user_info.username # => "j.doe"
104
+ ```
105
+
106
+ ### Revoking tokens
107
+
108
+ Revokes a refresh token. Accepts a token string or a `Token` object (which uses its `refresh_token`):
109
+
110
+ ```ruby
111
+ client.revoke_token(token)
112
+ ```
113
+
114
+ ### Logout URI
115
+
116
+ ```ruby
117
+ url = client.logout_uri(
118
+ logout_uri: "https://example.com/signed-out",
119
+ redirect_uri: "https://example.com/"
120
+ )
121
+ ```
122
+
123
+ ### Error handling
124
+
125
+ All API calls raise `CognitoIdp::Error` on non-2xx responses:
126
+
127
+ ```ruby
128
+ begin
129
+ client.get_token(grant_type: "authorization_code", code: "expired_code")
130
+ rescue CognitoIdp::Error => e
131
+ e.error # => "invalid_grant"
132
+ e.error_description # => "Authorization code has expired"
133
+ e.http_status # => 400
134
+ end
135
+ ```
18
136
 
19
137
  ## Development
20
138
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module CognitoIdp
4
4
  class AuthorizationUri
5
- attr_accessor :client_id, :code_challenge_method, :code_challenge, :domain,
5
+ attr_reader :client_id, :code_challenge_method, :code_challenge, :domain,
6
6
  :idp_identifier, :identity_provider, :nonce, :redirect_uri, :response_type,
7
7
  :scope, :state
8
8
 
@@ -5,7 +5,7 @@ require "faraday"
5
5
 
6
6
  module CognitoIdp
7
7
  class Client
8
- attr_accessor :adapter, :client_id, :client_secret, :domain
8
+ attr_reader :adapter, :client_id, :client_secret, :domain
9
9
 
10
10
  def initialize(client_id:, domain:, client_secret: nil, adapter: Faraday.default_adapter, stubs: nil)
11
11
  @adapter = adapter
@@ -15,6 +15,14 @@ module CognitoIdp
15
15
  @stubs = stubs
16
16
  end
17
17
 
18
+ def inspect
19
+ "#<#{self.class}:0x#{object_id.to_s(16)} " \
20
+ "@adapter=#{adapter.inspect}, " \
21
+ "@client_id=#{client_id.inspect}, " \
22
+ "@client_secret=#{client_secret.nil? ? "nil" : "[REDACTED]"}, " \
23
+ "@domain=#{domain.inspect}>"
24
+ end
25
+
18
26
  def authorization_uri(redirect_uri:, **options)
19
27
  AuthorizationUri.new(
20
28
  client_id: client_id,
@@ -35,7 +43,7 @@ module CognitoIdp
35
43
  scope: options[:scope]
36
44
  }.compact
37
45
  response = connection.post("/oauth2/token", params, basic_authorization_headers)
38
- return unless response.success?
46
+ handle_error_response(response)
39
47
 
40
48
  token = Token.new(response.body)
41
49
  yield(token) if block_given?
@@ -50,13 +58,26 @@ module CognitoIdp
50
58
  token
51
59
  end
52
60
  response = connection.post("/oauth2/userInfo", nil, {"Authorization" => "Bearer #{access_token}"})
53
- return unless response.success?
61
+ handle_error_response(response)
54
62
 
55
63
  user_info = UserInfo.new(response.body)
56
64
  yield(user_info) if block_given?
57
65
  user_info
58
66
  end
59
67
 
68
+ def revoke_token(token)
69
+ refresh_token = case token
70
+ when Token
71
+ token.refresh_token
72
+ else
73
+ token
74
+ end
75
+
76
+ params = {client_id: client_id, token: refresh_token}
77
+ response = connection.post("/oauth2/revoke", params, basic_authorization_headers)
78
+ handle_error_response(response)
79
+ end
80
+
60
81
  def logout_uri(**options)
61
82
  LogoutUri.new(
62
83
  client_id: client_id,
@@ -76,11 +97,30 @@ module CognitoIdp
76
97
  end
77
98
  end
78
99
 
100
+ def handle_error_response(response)
101
+ return if response.success?
102
+
103
+ body = response.body
104
+ if body.is_a?(Hash) && body["error"]
105
+ raise Error.new(
106
+ error: body["error"],
107
+ error_description: body["error_description"],
108
+ http_status: response.status
109
+ )
110
+ else
111
+ raise Error.new(
112
+ error: "http_error",
113
+ error_description: "the server responded with status #{response.status}",
114
+ http_status: response.status
115
+ )
116
+ end
117
+ end
118
+
79
119
  def basic_authorization_headers
80
120
  return if client_secret.nil?
81
121
 
82
122
  client_id_and_secret = "#{client_id}:#{client_secret}"
83
- {"Authorization" => "Basic #{Base64.urlsafe_encode64(client_id_and_secret)}"}
123
+ {"Authorization" => "Basic #{Base64.strict_encode64(client_id_and_secret)}"}
84
124
  end
85
125
  end
86
126
  end
@@ -1,5 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CognitoIdp
4
- class Error < StandardError; end
4
+ class Error < StandardError
5
+ attr_reader :error, :error_description, :http_status
6
+
7
+ def initialize(error:, error_description: nil, http_status: nil)
8
+ @error = error
9
+ @error_description = error_description
10
+ @http_status = http_status
11
+ super(build_message)
12
+ end
13
+
14
+ private
15
+
16
+ def build_message
17
+ return error if error_description.nil?
18
+
19
+ "#{error}: #{error_description}"
20
+ end
21
+ end
5
22
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module CognitoIdp
4
4
  class LogoutUri
5
- attr_accessor :client_id, :domain, :logout_uri, :redirect_uri, :response_type, :scope, :state
5
+ attr_reader :client_id, :domain, :logout_uri, :redirect_uri, :response_type, :scope, :state
6
6
 
7
7
  def initialize(client_id:, domain:, **options)
8
8
  @client_id = client_id
@@ -14,5 +14,21 @@ module CognitoIdp
14
14
  end
15
15
  @expires_at = Time.now + expires_in unless expires_in.nil?
16
16
  end
17
+
18
+ def expired?
19
+ return false if expires_at.nil?
20
+
21
+ Time.now >= expires_at
22
+ end
23
+
24
+ def inspect
25
+ "#<#{self.class}:0x#{object_id.to_s(16)} " \
26
+ "@access_token=#{access_token.nil? ? "nil" : "[REDACTED]"}, " \
27
+ "@id_token=#{id_token.nil? ? "nil" : "[REDACTED]"}, " \
28
+ "@token_type=#{token_type.inspect}, " \
29
+ "@expires_in=#{expires_in.inspect}, " \
30
+ "@expires_at=#{expires_at.inspect}, " \
31
+ "@refresh_token=#{refresh_token.nil? ? "nil" : "[REDACTED]"}>"
32
+ end
17
33
  end
18
34
  end
@@ -14,7 +14,7 @@ module CognitoIdp
14
14
  end
15
15
 
16
16
  def respond_to_missing?(method, include_private = false)
17
- true
17
+ @attributes.respond_to?(method, include_private) || super
18
18
  end
19
19
  end
20
20
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CognitoIdp
4
- VERSION = "0.2.0"
4
+ VERSION = "1.0.0"
5
5
  end
data/lib/cognito_idp.rb CHANGED
@@ -5,6 +5,7 @@ require "cognito_idp/version"
5
5
  module CognitoIdp
6
6
  autoload :AuthorizationUri, "cognito_idp/authorization_uri"
7
7
  autoload :Client, "cognito_idp/client"
8
+ autoload :Error, "cognito_idp/error"
8
9
  autoload :LogoutUri, "cognito_idp/logout_uri"
9
10
  autoload :Token, "cognito_idp/token"
10
11
  autoload :UserInfo, "cognito_idp/user_info"
@@ -0,0 +1,25 @@
1
+ module CognitoIdp
2
+ class AuthorizationUri
3
+ attr_reader client_id: String
4
+ attr_reader code_challenge_method: String?
5
+ attr_reader code_challenge: String?
6
+ attr_reader domain: String
7
+ attr_reader idp_identifier: String?
8
+ attr_reader identity_provider: String?
9
+ attr_reader nonce: String?
10
+ attr_reader redirect_uri: String
11
+ attr_reader response_type: Symbol
12
+ attr_reader scope: String | Array[String] | nil
13
+ attr_reader state: String?
14
+
15
+ def initialize: (client_id: String, domain: String, redirect_uri: String, ?response_type: Symbol, **untyped) -> void
16
+
17
+ def to_s: () -> String
18
+
19
+ private
20
+
21
+ def params: () -> Hash[Symbol, untyped]
22
+
23
+ def scope_string: () -> String?
24
+ end
25
+ end
@@ -1,6 +1,32 @@
1
1
  module CognitoIdp
2
- module Client
3
- VERSION: String
4
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
2
+ class Client
3
+ attr_reader adapter: Symbol
4
+ attr_reader client_id: String
5
+ attr_reader client_secret: String?
6
+ attr_reader domain: String
7
+
8
+ def initialize: (client_id: String, domain: String, ?client_secret: String?, ?adapter: Symbol, ?stubs: untyped) -> void
9
+
10
+ def inspect: () -> String
11
+
12
+ def authorization_uri: (redirect_uri: String, **untyped) -> String
13
+
14
+ def get_token: (grant_type: String | Symbol, **untyped) -> Token
15
+ | (grant_type: String | Symbol, **untyped) { (Token) -> void } -> Token
16
+
17
+ def get_user_info: (Token | String) -> UserInfo
18
+ | (Token | String) { (UserInfo) -> void } -> UserInfo
19
+
20
+ def revoke_token: (Token | String) -> void
21
+
22
+ def logout_uri: (**untyped) -> String
23
+
24
+ private
25
+
26
+ def connection: () -> untyped
27
+
28
+ def handle_error_response: (untyped) -> void
29
+
30
+ def basic_authorization_headers: () -> Hash[String, String]?
5
31
  end
6
32
  end
@@ -0,0 +1,13 @@
1
+ module CognitoIdp
2
+ class Error < StandardError
3
+ attr_reader error: String
4
+ attr_reader error_description: String?
5
+ attr_reader http_status: Integer?
6
+
7
+ def initialize: (error: String, ?error_description: String?, ?http_status: Integer?) -> void
8
+
9
+ private
10
+
11
+ def build_message: () -> String
12
+ end
13
+ end
@@ -0,0 +1,21 @@
1
+ module CognitoIdp
2
+ class LogoutUri
3
+ attr_reader client_id: String
4
+ attr_reader domain: String
5
+ attr_reader logout_uri: String?
6
+ attr_reader redirect_uri: String?
7
+ attr_reader response_type: Symbol?
8
+ attr_reader scope: String | Array[String] | nil
9
+ attr_reader state: String?
10
+
11
+ def initialize: (client_id: String, domain: String, **untyped) -> void
12
+
13
+ def to_s: () -> String
14
+
15
+ private
16
+
17
+ def params: () -> Hash[Symbol, untyped]
18
+
19
+ def scope_string: () -> String?
20
+ end
21
+ end
@@ -0,0 +1,16 @@
1
+ module CognitoIdp
2
+ class Token
3
+ attr_reader access_token: String?
4
+ attr_reader id_token: String?
5
+ attr_reader token_type: String?
6
+ attr_reader expires_at: Time?
7
+ attr_reader expires_in: Integer?
8
+ attr_reader refresh_token: String?
9
+
10
+ def initialize: (Hash[String | Symbol, untyped]) -> void
11
+
12
+ def expired?: () -> bool
13
+
14
+ def inspect: () -> String
15
+ end
16
+ end
@@ -0,0 +1,11 @@
1
+ module CognitoIdp
2
+ class UserInfo
3
+ def initialize: (Hash[String | Symbol, untyped]) -> void
4
+
5
+ private
6
+
7
+ def method_missing: (Symbol, *untyped) -> untyped
8
+
9
+ def respond_to_missing?: (Symbol, ?bool) -> bool
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ module CognitoIdp
2
+ VERSION: String
3
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cognito_idp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Hatherall
@@ -37,6 +37,20 @@ dependencies:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
39
  version: '2.7'
40
+ - !ruby/object:Gem::Dependency
41
+ name: ostruct
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ type: :runtime
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
40
54
  description: Client for interacting with Amazon Cognito IdP (User Pools) endpoints.
41
55
  email:
42
56
  - richard@appercept.com
@@ -44,14 +58,9 @@ executables: []
44
58
  extensions: []
45
59
  extra_rdoc_files: []
46
60
  files:
47
- - ".rspec"
48
- - ".rubocop.yml"
49
- - ".standard.yml"
50
61
  - CHANGELOG.md
51
- - CODE_OF_CONDUCT.md
52
62
  - LICENSE
53
63
  - README.md
54
- - Rakefile
55
64
  - lib/cognito_idp.rb
56
65
  - lib/cognito_idp/authorization_uri.rb
57
66
  - lib/cognito_idp/client.rb
@@ -60,7 +69,13 @@ files:
60
69
  - lib/cognito_idp/token.rb
61
70
  - lib/cognito_idp/user_info.rb
62
71
  - lib/cognito_idp/version.rb
72
+ - sig/cognito_idp.rbs
73
+ - sig/cognito_idp/authorization_uri.rbs
63
74
  - sig/cognito_idp/client.rbs
75
+ - sig/cognito_idp/error.rbs
76
+ - sig/cognito_idp/logout_uri.rbs
77
+ - sig/cognito_idp/token.rbs
78
+ - sig/cognito_idp/user_info.rbs
64
79
  homepage: https://github.com/appercept/cognito_idp-ruby
65
80
  licenses:
66
81
  - MIT
@@ -75,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
75
90
  requirements:
76
91
  - - ">="
77
92
  - !ruby/object:Gem::Version
78
- version: 2.6.0
93
+ version: 2.7.0
79
94
  required_rubygems_version: !ruby/object:Gem::Requirement
80
95
  requirements:
81
96
  - - ">="
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --format documentation
2
- --color
3
- --require spec_helper
data/.rubocop.yml DELETED
@@ -1,6 +0,0 @@
1
- ---
2
- inherit_gem:
3
- standard: config/base.yml
4
-
5
- require:
6
- - standard
data/.standard.yml DELETED
@@ -1,3 +0,0 @@
1
- # For available configuration options, see:
2
- # https://github.com/testdouble/standard
3
- ruby_version: 2.6
data/CODE_OF_CONDUCT.md DELETED
@@ -1,84 +0,0 @@
1
- # Contributor Covenant Code of Conduct
2
-
3
- ## Our Pledge
4
-
5
- We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
-
7
- We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
-
9
- ## Our Standards
10
-
11
- Examples of behavior that contributes to a positive environment for our community include:
12
-
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
18
-
19
- Examples of unacceptable behavior include:
20
-
21
- * The use of sexualized language or imagery, and sexual attention or
22
- advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
26
- address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
28
- professional setting
29
-
30
- ## Enforcement Responsibilities
31
-
32
- Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
-
34
- Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
-
36
- ## Scope
37
-
38
- This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
-
40
- ## Enforcement
41
-
42
- Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at richard@appercept.com. All complaints will be reviewed and investigated promptly and fairly.
43
-
44
- All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
-
46
- ## Enforcement Guidelines
47
-
48
- Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
-
50
- ### 1. Correction
51
-
52
- **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
-
54
- **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
-
56
- ### 2. Warning
57
-
58
- **Community Impact**: A violation through a single incident or series of actions.
59
-
60
- **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
-
62
- ### 3. Temporary Ban
63
-
64
- **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
-
66
- **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
-
68
- ### 4. Permanent Ban
69
-
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
-
72
- **Consequence**: A permanent ban from any sort of public interaction within the community.
73
-
74
- ## Attribution
75
-
76
- This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
- available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
-
79
- Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
-
81
- [homepage]: https://www.contributor-covenant.org
82
-
83
- For answers to common questions about this code of conduct, see the FAQ at
84
- https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- require "standard/rake"
9
-
10
- task default: %i[spec standard]