password_auth 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/Gemfile +8 -0
- data/README.md +35 -0
- data/Rakefile +4 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/password_auth/version.rb +5 -0
- data/lib/password_auth.rb +19 -0
- data/password_auth.gemspec +46 -0
- metadata +84 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 439bfc5afd633d4f9b1aa53f180c7e0507346d6734175513bfdbb7a370491690
|
4
|
+
data.tar.gz: f544fc3be6fc470b9d3134998470db637dcaa1548f08bbb6faf314eb35276130
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1abf167d5187df7c105a2a923d0371db67c9f17c99699a7f1c9bc4f3b93ee88f3a173b432e07969a1456b50718cfe7945fd0a1293ccbecf70c22c0cc43b0b4ae
|
7
|
+
data.tar.gz: 1cf6367ee4041bde67959add2a0fd5636ef7e284f5f80f1c02fc137938c0fb596483952ccccf155c285a844f610d3846315efd47acd57a2971fb8240d7dbd91b
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# PasswordAuth
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/password_auth`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'password_auth'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle install
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install password_auth
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/password_auth.
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "password_auth"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "password_auth/version"
|
4
|
+
require 'bcrypt'
|
5
|
+
|
6
|
+
module PasswordAuth
|
7
|
+
class Error < StandardError; end
|
8
|
+
# Your code goes here...
|
9
|
+
class << self
|
10
|
+
def hash_password(password)
|
11
|
+
BCrypt::Password.create(password)
|
12
|
+
end
|
13
|
+
|
14
|
+
def password_valid?(password, hashed_password)
|
15
|
+
bcrypt_password = BCrypt::Password.new(hashed_password)
|
16
|
+
bcrypt_password == password
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative "lib/password_auth/version"
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "password_auth"
|
7
|
+
spec.version = PasswordAuth::VERSION
|
8
|
+
spec.authors = ["symmetrically"]
|
9
|
+
spec.email = ["sadanmasroor87@gmail.com"]
|
10
|
+
|
11
|
+
spec.summary = "The `password_auth` gem provides a simple and secure way to handle password authentication in Ruby applications. It offers a set of reusable components and utilities to handle user passwords, including password hashing, salting, and validation."
|
12
|
+
spec.description = "The `password_auth` gem provides a simple and secure way to handle password authentication in Ruby applications. It offers a set of reusable components and utilities to handle user passwords, including password hashing, salting, and validation.
|
13
|
+
|
14
|
+
Key Features:
|
15
|
+
- Secure password storage: The gem uses industry-standard techniques, such as bcrypt hashing and salt generation, to securely store user passwords.
|
16
|
+
- Password validation: It provides convenient methods to validate the strength and complexity of user passwords, ensuring they meet specific criteria.
|
17
|
+
- Password encryption: Easily encrypt passwords for storage or comparison purposes, protecting sensitive user data.
|
18
|
+
- Password reset functionality: Includes utilities for generating and handling password reset tokens, enabling users to securely reset their passwords.
|
19
|
+
- Integration with popular frameworks: Seamlessly integrates with Ruby on Rails, Sinatra, and other Ruby frameworks, making it easy to incorporate password authentication into your application.
|
20
|
+
|
21
|
+
By using the `password_auth` gem, developers can implement robust password authentication functionality in their Ruby applications with minimal effort, ensuring the security and integrity of user passwords."
|
22
|
+
spec.homepage = "https://rubygems.org/"
|
23
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
|
24
|
+
|
25
|
+
# spec.metadata["allowed_push_host"] = "TODO: Set to 'http://mygemserver.com'"
|
26
|
+
|
27
|
+
# spec.metadata["homepage_uri"] = spec.homepage
|
28
|
+
spec.metadata['homepage_uri'] = 'https://github.com/mudabbir-apptimumlabs/password_auth'
|
29
|
+
spec.metadata["source_code_uri"] = "https://github.com/mudabbir-apptimumlabs/passwor_auth.git"
|
30
|
+
spec.metadata['changelog_uri'] = 'https://github.com/mudabbir-apptimumlabs/password_auth/blob/main/CHANGELOG.md'
|
31
|
+
|
32
|
+
# Specify which files should be added to the gem when it is released.
|
33
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
34
|
+
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
35
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{\A(?:test|spec|features)/}) }
|
36
|
+
end
|
37
|
+
spec.bindir = "exe"
|
38
|
+
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
39
|
+
spec.require_paths = ["lib"]
|
40
|
+
|
41
|
+
# Uncomment to register a new dependency of your gem
|
42
|
+
# spec.add_dependency "example-gem", "~> 1.0"
|
43
|
+
spec.add_dependency 'bcrypt', '~> 3.1'
|
44
|
+
# For more information and examples about making a new gem, checkout our
|
45
|
+
# guide at: https://bundler.io/guides/creating_gem.html
|
46
|
+
end
|
metadata
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: password_auth
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- symmetrically
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2023-05-18 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bcrypt
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.1'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.1'
|
27
|
+
description: "The `password_auth` gem provides a simple and secure way to handle password
|
28
|
+
authentication in Ruby applications. It offers a set of reusable components and
|
29
|
+
utilities to handle user passwords, including password hashing, salting, and validation.\n\n
|
30
|
+
\ Key Features:\n - Secure password storage: The gem uses industry-standard techniques,
|
31
|
+
such as bcrypt hashing and salt generation, to securely store user passwords.\n
|
32
|
+
\ - Password validation: It provides convenient methods to validate the strength
|
33
|
+
and complexity of user passwords, ensuring they meet specific criteria.\n - Password
|
34
|
+
encryption: Easily encrypt passwords for storage or comparison purposes, protecting
|
35
|
+
sensitive user data.\n - Password reset functionality: Includes utilities for generating
|
36
|
+
and handling password reset tokens, enabling users to securely reset their passwords.\n
|
37
|
+
\ - Integration with popular frameworks: Seamlessly integrates with Ruby on Rails,
|
38
|
+
Sinatra, and other Ruby frameworks, making it easy to incorporate password authentication
|
39
|
+
into your application.\n \n By using the `password_auth` gem, developers can implement
|
40
|
+
robust password authentication functionality in their Ruby applications with minimal
|
41
|
+
effort, ensuring the security and integrity of user passwords."
|
42
|
+
email:
|
43
|
+
- sadanmasroor87@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- Gemfile
|
50
|
+
- README.md
|
51
|
+
- Rakefile
|
52
|
+
- bin/console
|
53
|
+
- bin/setup
|
54
|
+
- lib/password_auth.rb
|
55
|
+
- lib/password_auth/version.rb
|
56
|
+
- password_auth.gemspec
|
57
|
+
homepage: https://rubygems.org/
|
58
|
+
licenses: []
|
59
|
+
metadata:
|
60
|
+
homepage_uri: https://github.com/mudabbir-apptimumlabs/password_auth
|
61
|
+
source_code_uri: https://github.com/mudabbir-apptimumlabs/passwor_auth.git
|
62
|
+
changelog_uri: https://github.com/mudabbir-apptimumlabs/password_auth/blob/main/CHANGELOG.md
|
63
|
+
post_install_message:
|
64
|
+
rdoc_options: []
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: 2.3.0
|
72
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
requirements: []
|
78
|
+
rubygems_version: 3.2.3
|
79
|
+
signing_key:
|
80
|
+
specification_version: 4
|
81
|
+
summary: The `password_auth` gem provides a simple and secure way to handle password
|
82
|
+
authentication in Ruby applications. It offers a set of reusable components and
|
83
|
+
utilities to handle user passwords, including password hashing, salting, and validation.
|
84
|
+
test_files: []
|