cow_auth 0.7.1 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/CODE_OF_CONDUCT.md +57 -47
- data/Gemfile +2 -1
- data/Gemfile.lock +16 -18
- data/LICENSE.txt +1 -1
- data/README.md +2 -2
- data/Rakefile +1 -1
- data/lib/cow_auth/version.rb +1 -1
- data/lib/cow_auth.rb +9 -7
- data/sig/cow_auth.rbs +4 -0
- metadata +8 -11
- data/.gitignore +0 -8
- data/.travis.yml +0 -6
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/cow_auth.gemspec +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5287296159ba0b9e6768102d3efda06d2622072a10b04ad3a1dbcd276e276a39
|
4
|
+
data.tar.gz: 8b1b885c4689735f6af90fbbd8156f0ecc646194fa7733d3a6262d2a4cbefec2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3fc07060b931733576d1acf0358f90fc7c6274e974d6833854da995dc074fcb007d714a4a9d168e8778ee72d1aee7f032428784b763ae7b7334fa63cbd2b3448
|
7
|
+
data.tar.gz: 2272403f84cf980a3603e74943d24e37408d91e771ac658c7aedc8fdda48263019c008431eca3ea4adfa975d3e3fde83ce350be5872e5441c7267134fef6aba1
|
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
CHANGED
@@ -2,73 +2,83 @@
|
|
2
2
|
|
3
3
|
## Our Pledge
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
-
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
-
orientation.
|
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.
|
11
8
|
|
12
9
|
## Our Standards
|
13
10
|
|
14
|
-
Examples of behavior that contributes to
|
15
|
-
include:
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
16
12
|
|
17
|
-
*
|
18
|
-
* Being respectful of differing viewpoints and experiences
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
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
|
22
18
|
|
23
|
-
Examples of unacceptable behavior
|
19
|
+
Examples of unacceptable behavior include:
|
24
20
|
|
25
|
-
* The use of sexualized language or imagery and
|
26
|
-
advances
|
27
|
-
* Trolling, insulting
|
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
|
28
24
|
* Public or private harassment
|
29
|
-
* Publishing others' private information, such as a physical or
|
30
|
-
address, without explicit permission
|
25
|
+
* Publishing others' private information, such as a physical or email
|
26
|
+
address, without their explicit permission
|
31
27
|
* Other conduct which could reasonably be considered inappropriate in a
|
32
28
|
professional setting
|
33
29
|
|
34
|
-
##
|
30
|
+
## Enforcement Responsibilities
|
35
31
|
|
36
|
-
|
37
|
-
behavior and are expected to take appropriate and fair corrective action in
|
38
|
-
response to any instances of unacceptable behavior.
|
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.
|
39
33
|
|
40
|
-
|
41
|
-
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
-
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
-
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
-
threatening, offensive, or harmful.
|
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.
|
45
35
|
|
46
36
|
## Scope
|
47
37
|
|
48
|
-
This Code of Conduct applies
|
49
|
-
when an individual is representing the project or its community. Examples of
|
50
|
-
representing a project or community include using an official project e-mail
|
51
|
-
address, posting via an official social media account, or acting as an appointed
|
52
|
-
representative at an online or offline event. Representation of a project may be
|
53
|
-
further defined and clarified by project maintainers.
|
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.
|
54
39
|
|
55
40
|
## Enforcement
|
56
41
|
|
57
|
-
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
42
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at mickey@cowden.tech. 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.
|
63
59
|
|
64
|
-
|
65
|
-
|
66
|
-
|
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.
|
67
73
|
|
68
74
|
## Attribution
|
69
75
|
|
70
|
-
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version
|
71
|
-
available at
|
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
|
72
82
|
|
73
|
-
|
74
|
-
|
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/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,38 +1,36 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
cow_auth (0.
|
5
|
-
activerecord (~>
|
4
|
+
cow_auth (0.8.0)
|
5
|
+
activerecord (~> 7.0)
|
6
6
|
scrypt (~> 3.0)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activemodel (
|
12
|
-
activesupport (=
|
13
|
-
activerecord (
|
14
|
-
activemodel (=
|
15
|
-
activesupport (=
|
16
|
-
activesupport (
|
11
|
+
activemodel (7.0.4)
|
12
|
+
activesupport (= 7.0.4)
|
13
|
+
activerecord (7.0.4)
|
14
|
+
activemodel (= 7.0.4)
|
15
|
+
activesupport (= 7.0.4)
|
16
|
+
activesupport (7.0.4)
|
17
17
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
18
18
|
i18n (>= 1.6, < 2)
|
19
19
|
minitest (>= 5.1)
|
20
20
|
tzinfo (~> 2.0)
|
21
|
-
|
22
|
-
|
23
|
-
ffi (1.15.0)
|
21
|
+
concurrent-ruby (1.1.10)
|
22
|
+
ffi (1.15.5)
|
24
23
|
ffi-compiler (1.0.1)
|
25
24
|
ffi (>= 1.0.0)
|
26
25
|
rake
|
27
|
-
i18n (1.
|
26
|
+
i18n (1.12.0)
|
28
27
|
concurrent-ruby (~> 1.0)
|
29
|
-
minitest (5.
|
30
|
-
rake (
|
28
|
+
minitest (5.16.3)
|
29
|
+
rake (13.0.6)
|
31
30
|
scrypt (3.0.7)
|
32
31
|
ffi-compiler (>= 1.0, < 2.0)
|
33
|
-
tzinfo (2.0.
|
32
|
+
tzinfo (2.0.5)
|
34
33
|
concurrent-ruby (~> 1.0)
|
35
|
-
zeitwerk (2.4.2)
|
36
34
|
|
37
35
|
PLATFORMS
|
38
36
|
ruby
|
@@ -40,7 +38,7 @@ PLATFORMS
|
|
40
38
|
DEPENDENCIES
|
41
39
|
cow_auth!
|
42
40
|
minitest (~> 5.0)
|
43
|
-
rake (~>
|
41
|
+
rake (~> 13.0)
|
44
42
|
|
45
43
|
BUNDLED WITH
|
46
|
-
2.
|
44
|
+
2.3.22
|
data/LICENSE.txt
CHANGED
data/README.md
CHANGED
@@ -26,12 +26,12 @@ Configure your user model to add the authentication mechanism.
|
|
26
26
|
|
27
27
|
#### Generator (Example)
|
28
28
|
|
29
|
-
$ bundle exec rails generate model user uuid:string:uniq email:string:uniq sid:string:uniq encrypted_password:string
|
29
|
+
$ bundle exec rails generate model user uuid:string:uniq email:string:uniq sid:string:uniq locale:string encrypted_password:string auth_token:string first_name:string last_name:string sign_in_count:integer is_enabled:boolean is_deleted:boolean expires_at:timestamp
|
30
30
|
|
31
31
|
#### Migration (Example)
|
32
32
|
|
33
33
|
# Modified migration; includes indexes and other stuff you might not want.
|
34
|
-
class CreateUsers < ActiveRecord::Migration[
|
34
|
+
class CreateUsers < ActiveRecord::Migration[7.0]
|
35
35
|
def change
|
36
36
|
create_table :users do |t|
|
37
37
|
t.string :uuid, null: false
|
data/Rakefile
CHANGED
data/lib/cow_auth/version.rb
CHANGED
data/lib/cow_auth.rb
CHANGED
@@ -1,12 +1,14 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
require_relative 'cow_auth/version'
|
2
|
+
require_relative 'cow_auth/user'
|
3
|
+
require_relative 'cow_auth/exceptions'
|
4
|
+
require_relative 'cow_auth/session_auth/session_endpoints'
|
5
|
+
require_relative 'cow_auth/session_auth/authenticate_request'
|
6
|
+
require_relative 'cow_auth/token_auth/session_endpoints'
|
7
|
+
require_relative 'cow_auth/token_auth/authenticate_request'
|
8
8
|
|
9
9
|
module CowAuth
|
10
|
+
class Error < StandardError; end
|
11
|
+
|
10
12
|
def self.moo
|
11
13
|
puts 'Moo Cow: ' + CowAuth::VERSION
|
12
14
|
return CowAuth::User.new
|
data/sig/cow_auth.rbs
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cow_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mickey Cowden
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '7.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '7.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: scrypt
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -46,17 +46,13 @@ executables: []
|
|
46
46
|
extensions: []
|
47
47
|
extra_rdoc_files: []
|
48
48
|
files:
|
49
|
-
-
|
50
|
-
- ".travis.yml"
|
49
|
+
- CHANGELOG.md
|
51
50
|
- CODE_OF_CONDUCT.md
|
52
51
|
- Gemfile
|
53
52
|
- Gemfile.lock
|
54
53
|
- LICENSE.txt
|
55
54
|
- README.md
|
56
55
|
- Rakefile
|
57
|
-
- bin/console
|
58
|
-
- bin/setup
|
59
|
-
- cow_auth.gemspec
|
60
56
|
- lib/cow_auth.rb
|
61
57
|
- lib/cow_auth/exceptions.rb
|
62
58
|
- lib/cow_auth/session_auth/authenticate_request.rb
|
@@ -65,6 +61,7 @@ files:
|
|
65
61
|
- lib/cow_auth/token_auth/session_endpoints.rb
|
66
62
|
- lib/cow_auth/user.rb
|
67
63
|
- lib/cow_auth/version.rb
|
64
|
+
- sig/cow_auth.rbs
|
68
65
|
homepage: https://github.com/mickey13/cow-auth
|
69
66
|
licenses:
|
70
67
|
- MIT
|
@@ -80,14 +77,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
80
77
|
requirements:
|
81
78
|
- - ">="
|
82
79
|
- !ruby/object:Gem::Version
|
83
|
-
version: 2.
|
80
|
+
version: 2.6.0
|
84
81
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
85
82
|
requirements:
|
86
83
|
- - ">="
|
87
84
|
- !ruby/object:Gem::Version
|
88
85
|
version: '0'
|
89
86
|
requirements: []
|
90
|
-
rubygems_version: 3.
|
87
|
+
rubygems_version: 3.3.22
|
91
88
|
signing_key:
|
92
89
|
specification_version: 4
|
93
90
|
summary: Authentication gem
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require 'bundler/setup'
|
4
|
-
require 'cow_auth'
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require 'pry'
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require 'irb'
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/cow_auth.gemspec
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
require_relative 'lib/cow_auth/version'
|
2
|
-
|
3
|
-
Gem::Specification.new do |spec|
|
4
|
-
spec.name = 'cow_auth'
|
5
|
-
spec.version = CowAuth::VERSION
|
6
|
-
spec.authors = ['Mickey Cowden']
|
7
|
-
spec.email = ['mickey@cowden.tech']
|
8
|
-
|
9
|
-
spec.summary = 'Authentication gem'
|
10
|
-
spec.description = 'The goal of this gem is to provide token-based authentication for Rails (or Rails-like) web applications.'
|
11
|
-
spec.homepage = 'https://github.com/mickey13/cow-auth'
|
12
|
-
spec.license = 'MIT'
|
13
|
-
spec.required_ruby_version = Gem::Requirement.new('>= 2.3.0')
|
14
|
-
|
15
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
16
|
-
spec.metadata['source_code_uri'] = spec.homepage
|
17
|
-
spec.metadata['changelog_uri'] = spec.homepage
|
18
|
-
|
19
|
-
# Specify which files should be added to the gem when it is released.
|
20
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
21
|
-
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
22
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
23
|
-
end
|
24
|
-
spec.bindir = 'exe'
|
25
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
|
-
spec.require_paths = ['lib']
|
27
|
-
|
28
|
-
spec.add_runtime_dependency 'activerecord', '~> 6.0'
|
29
|
-
spec.add_runtime_dependency 'scrypt', '~> 3.0'
|
30
|
-
end
|