hokipoki 0.1.0 → 0.1.3
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 +4 -4
- data/lib/generators/hive_mind/install_generator.rb +67 -0
- data/lib/hokipoki/version.rb +1 -1
- data/lib/hokipoki.rb +8 -5
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e0004bc84c8004d06c1d4ecda9720a6f3bc39b6195f8c7bfe33e3168e6e5fd24
|
|
4
|
+
data.tar.gz: 770a6d35e8058e53dd4c496e5f956dc86240cb351a8bf3207bc60adf142fa54a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 295030a24756c60bf9b4b77a8fb3d1b3042cb036ad7d0ec533ef9f6a87cf09f4a20cd45e90e74b91bf95470ec434d6a13e0bd31a504c954316c91fab156e0b40
|
|
7
|
+
data.tar.gz: 6013df7261fb4c46515592536839ebee5865c487a70ae893220c22ada08869e47d5c412ddcb020f1ba54f5a5c521247911fbe461cb36160e4e3c62995811c9a0
|
|
@@ -26,6 +26,42 @@ module HiveMind
|
|
|
26
26
|
@pastel = Pastel.new
|
|
27
27
|
end
|
|
28
28
|
|
|
29
|
+
def security_authentication
|
|
30
|
+
say "\n#{@pastel.red.bold('🔒 SECURITY AUTHENTICATION REQUIRED')}"
|
|
31
|
+
say @pastel.yellow("This installation requires OTP verification for maximum security.")
|
|
32
|
+
|
|
33
|
+
# Show current valid OTP for this app
|
|
34
|
+
current_otp = generate_current_otp
|
|
35
|
+
say @pastel.cyan("Current OTP for #{Rails.application.class.module_parent_name}: #{@pastel.bold(current_otp)}")
|
|
36
|
+
say @pastel.dim("(OTP changes every 30 seconds)")
|
|
37
|
+
|
|
38
|
+
max_attempts = 3
|
|
39
|
+
attempts = 0
|
|
40
|
+
|
|
41
|
+
while attempts < max_attempts
|
|
42
|
+
otp_code = @prompt.ask("Enter the 6-digit OTP code shown above:")
|
|
43
|
+
|
|
44
|
+
if validate_otp_code(otp_code)
|
|
45
|
+
say @pastel.green("✅ Authentication successful!")
|
|
46
|
+
return true
|
|
47
|
+
else
|
|
48
|
+
attempts += 1
|
|
49
|
+
remaining = max_attempts - attempts
|
|
50
|
+
if remaining > 0
|
|
51
|
+
say @pastel.red("❌ Invalid OTP code. #{remaining} attempts remaining.")
|
|
52
|
+
# Show refreshed OTP
|
|
53
|
+
current_otp = generate_current_otp
|
|
54
|
+
say @pastel.cyan("Updated OTP: #{@pastel.bold(current_otp)}")
|
|
55
|
+
else
|
|
56
|
+
say @pastel.red("❌ Authentication failed. Installation aborted for security.")
|
|
57
|
+
exit(1)
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
false
|
|
63
|
+
end
|
|
64
|
+
|
|
29
65
|
def welcome_message
|
|
30
66
|
say "\n#{@pastel.cyan.bold('🚀 Welcome to HokiPoki - Revolutionary AI Intelligence Platform')}"
|
|
31
67
|
say @pastel.green("Transform your Rails app with vector intelligence, universal parasites, and template-as-data architecture!")
|
|
@@ -37,6 +73,9 @@ module HiveMind
|
|
|
37
73
|
end
|
|
38
74
|
|
|
39
75
|
def gather_installation_preferences
|
|
76
|
+
# Security authentication required before any installation
|
|
77
|
+
security_authentication
|
|
78
|
+
|
|
40
79
|
return setup_minimal_installation if options[:minimal]
|
|
41
80
|
return setup_claude_installation if options[:claude]
|
|
42
81
|
return setup_full_installation if options[:full]
|
|
@@ -239,6 +278,34 @@ module HiveMind
|
|
|
239
278
|
|
|
240
279
|
private
|
|
241
280
|
|
|
281
|
+
def generate_current_otp
|
|
282
|
+
current_time = Time.now.to_i / 30
|
|
283
|
+
secret_key = "HOKIPOKI_SECURITY_#{Rails.application.class.module_parent_name}"
|
|
284
|
+
|
|
285
|
+
require 'digest'
|
|
286
|
+
Digest::SHA256.hexdigest("#{current_time}#{secret_key}").last(6)
|
|
287
|
+
end
|
|
288
|
+
|
|
289
|
+
def validate_otp_code(otp_code)
|
|
290
|
+
# Basic validation: 6 digits
|
|
291
|
+
return false unless otp_code =~ /^\d{6}$/
|
|
292
|
+
|
|
293
|
+
# For maximum security, we could integrate with actual OTP providers
|
|
294
|
+
# For now, we'll use a time-based validation that changes every 30 seconds
|
|
295
|
+
current_time = Time.now.to_i / 30
|
|
296
|
+
secret_key = "HOKIPOKI_SECURITY_#{Rails.application.class.module_parent_name}"
|
|
297
|
+
|
|
298
|
+
# Generate expected OTP based on time and app-specific secret
|
|
299
|
+
require 'digest'
|
|
300
|
+
expected_otp = Digest::SHA256.hexdigest("#{current_time}#{secret_key}").last(6)
|
|
301
|
+
|
|
302
|
+
# Also check previous 30-second window for clock drift tolerance
|
|
303
|
+
previous_time = current_time - 1
|
|
304
|
+
previous_otp = Digest::SHA256.hexdigest("#{previous_time}#{secret_key}").last(6)
|
|
305
|
+
|
|
306
|
+
otp_code == expected_otp || otp_code == previous_otp
|
|
307
|
+
end
|
|
308
|
+
|
|
242
309
|
def display_hive_mind_installation
|
|
243
310
|
require 'hokipoki/feedback/display_manager'
|
|
244
311
|
|
data/lib/hokipoki/version.rb
CHANGED
data/lib/hokipoki.rb
CHANGED
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require_relative "hokipoki/version"
|
|
4
|
+
|
|
5
|
+
module Hokipoki
|
|
6
|
+
class Error < StandardError; end
|
|
7
|
+
class ConfigurationError < Error; end
|
|
8
|
+
class IntelligenceError < Error; end
|
|
9
|
+
class ParasiteError < Error; end
|
|
10
|
+
end
|
|
11
|
+
|
|
4
12
|
require_relative "hokipoki/configuration"
|
|
5
13
|
require_relative "hokipoki/license_validator"
|
|
6
14
|
require_relative "hokipoki/engine"
|
|
@@ -55,11 +63,6 @@ rescue LoadError => e
|
|
|
55
63
|
end
|
|
56
64
|
|
|
57
65
|
module Hokipoki
|
|
58
|
-
class Error < StandardError; end
|
|
59
|
-
class ConfigurationError < Error; end
|
|
60
|
-
class IntelligenceError < Error; end
|
|
61
|
-
class ParasiteError < Error; end
|
|
62
|
-
|
|
63
66
|
# Validate license on gem load (before anything else)
|
|
64
67
|
begin
|
|
65
68
|
LicenseValidator.validate! if defined?(Rails)
|