authralia 0.0.1
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 +7 -0
- data/lib/authralia.rb +74 -0
- metadata +43 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c8385e74f10affaebc8489d31883c8cd31a7b73b2984e328fd5df68f4325be3a
|
4
|
+
data.tar.gz: c50197c0b40fab4121e3648b25ceff8c0dfd9e9c5d168aa0a9a7d7defa3be70e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: dac5585c2d7526e833ecade43d1472f085834ed55a1a35d2a8914c2930b91311b342b740deb8be3a9a91740b1a77aa9265f738ea85b57f3dd84362b04f266cab
|
7
|
+
data.tar.gz: e3b0bc76ae036c712d8cc79089f109a9bb49e9355a133a71a642c080035caed2da54fcc002fc4a4b675c781dfcdcaab2a09b3a05bd989653965a66f22e3fe0c2
|
data/lib/authralia.rb
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'rails'
|
4
|
+
|
5
|
+
module Authralia
|
6
|
+
module Authenticate
|
7
|
+
autoload :Base, 'authenticate/base'
|
8
|
+
autoload :Resource, 'authenticate/resource'
|
9
|
+
end
|
10
|
+
|
11
|
+
module AuthenticatedSession
|
12
|
+
autoload :Base, 'session/base'
|
13
|
+
autoload :Acceptence, 'authenticated_session/acceptence'
|
14
|
+
autoload :Creation, 'authenticated_session/creation'
|
15
|
+
autoload :Rejection, 'authenticated_session/rejection'
|
16
|
+
autoload :Removal, 'authenticated_session/removal'
|
17
|
+
autoload :Validation, 'authenticated_session/validation'
|
18
|
+
autoload :Wipeout, 'authenticated_session/wipeout'
|
19
|
+
end
|
20
|
+
|
21
|
+
module Controllers
|
22
|
+
autoload :Helpers, 'controllers/helpers'
|
23
|
+
end
|
24
|
+
|
25
|
+
module Models
|
26
|
+
autoload :ThydneyTheProtector, 'models/thydney_the_protector'
|
27
|
+
end
|
28
|
+
|
29
|
+
mattr_accessor :single_active_session
|
30
|
+
@@single_active_session = false
|
31
|
+
|
32
|
+
mattr_accessor :expires_in
|
33
|
+
@@expires_in = 1.hour
|
34
|
+
|
35
|
+
mattr_accessor :resource_class_names
|
36
|
+
@@resource_class_names = []
|
37
|
+
|
38
|
+
def self.setup
|
39
|
+
yield self
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
ActiveSupport.on_load(:action_controller_base) do
|
44
|
+
include WowAuthralia::Controllers::Helpers
|
45
|
+
end
|
46
|
+
|
47
|
+
ActiveSupport.on_load(:active_record) do
|
48
|
+
include WowAuthralia::Models::ThydneyTheProtector
|
49
|
+
end
|
50
|
+
|
51
|
+
module ActionDispatch::Routing
|
52
|
+
class Mapper
|
53
|
+
def when_authticanted(resource_class_name, &block)
|
54
|
+
constraint = lambda do |request|
|
55
|
+
request.session[resource_class_name.underscore].present?
|
56
|
+
end
|
57
|
+
|
58
|
+
constraints(constraint) do
|
59
|
+
yield
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
def when_unauthticanted(resource_class_name, &block)
|
64
|
+
constraint = lambda do |request|
|
65
|
+
request.session[resource_class_name.underscore].blank?
|
66
|
+
end
|
67
|
+
|
68
|
+
constraints(constraint) do
|
69
|
+
yield
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
metadata
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: authralia
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Gilang Mugni Respaty
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2022-11-16 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: A authentication dedicated to Mike Tyson
|
14
|
+
email: gilmoregarland@gmail.com
|
15
|
+
executables: []
|
16
|
+
extensions: []
|
17
|
+
extra_rdoc_files: []
|
18
|
+
files:
|
19
|
+
- lib/authralia.rb
|
20
|
+
homepage: https://rubygems.org/gems/hola
|
21
|
+
licenses:
|
22
|
+
- MIT
|
23
|
+
metadata: {}
|
24
|
+
post_install_message:
|
25
|
+
rdoc_options: []
|
26
|
+
require_paths:
|
27
|
+
- lib
|
28
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
29
|
+
requirements:
|
30
|
+
- - ">="
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
34
|
+
requirements:
|
35
|
+
- - ">="
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
requirements: []
|
39
|
+
rubygems_version: 3.3.25
|
40
|
+
signing_key:
|
41
|
+
specification_version: 4
|
42
|
+
summary: Authentication
|
43
|
+
test_files: []
|