repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/20_models/27_domains_methods_try.rb | tests/unit/ruby/try/20_models/27_domains_methods_try.rb | # tests/unit/ruby/try/20_models/27_domains_methods_try.rb
require 'securerandom'
require_relative '../test_models'
# Load the app
OT.boot! :test, false
@customer = Customer.create "Tryouts+27+#{SecureRandom.uuid}@onetimesecret.com"
@alt_customer = Customer.create "Tryouts+27+#{SecureRandom.uuid}@onetimesecret.com"
... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/20_models/29_customer_domains_try.rb | tests/unit/ruby/try/20_models/29_customer_domains_try.rb | # tests/unit/ruby/try/20_models/29_customer_domains_try.rb
# These tryouts test the customer custom domain relations
require_relative '../test_models'
OT.boot! :test, true # if this is false, all models will have db 0
# Setup some variables for these tryouts
@now = Time.now
@email_address = "tryouts29+#{@now.to_i}@... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/20_models/28_domains_verification_try.rb | tests/unit/ruby/try/20_models/28_domains_verification_try.rb | # tests/unit/ruby/try/20_models/28_domains_verification_try.rb
# frozen_string_literal: true
# These tryouts test the validation and verification status functionality of custom domains
require 'securerandom'
require_relative '../test_models'
# Load the app
OT.boot! :test, false
@now = Time.now
@customer_email = "t... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/24_logic_destroy_account_try.rb | tests/unit/ruby/try/60_logic/24_logic_destroy_account_try.rb | # tests/unit/ruby/try/60_logic/24_logic_destroy_account_try.rb
# These tryouts test the account destruction functionality in the Onetime application.
# They cover various aspects of the account destruction process, including:
#
# 1. Validating user input for account destruction
# 2. Handling password confirmation
# 3.... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/65_logic_exception_info_try.rb | tests/unit/ruby/try/60_logic/65_logic_exception_info_try.rb | # tests/unit/ruby/try/60_logic/65_logic_exception_info_try.rb
require_relative '../test_logic'
require 'securerandom'
# NOTE: ReceiveException is only in V2
# Setup
OT.boot! :test, false
@now = DateTime.now
@email = "test#{SecureRandom.uuid}@onetimesecret.com"
@sess = Session.new '255.255.255.255', 'anon'
@environm... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/04_logic_account_try.rb | tests/unit/ruby/try/60_logic/04_logic_account_try.rb | # tests/unit/ruby/try/60_logic/04_logic_account_try.rb
# NOTE: V1 has no account api functionality.
# These tests cover the Account logic classes which handle
# account management functionality.
#
# We test:
# 1. Account creation
# 2. Account updates (password, locale)
# 3. API token generation
# 4. Account retrieval... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/03_logic_secrets_try.rb | tests/unit/ruby/try/60_logic/03_logic_secrets_try.rb | # tests/unit/ruby/try/60_logic/03_logic_secrets_try.rb
# These tests cover the Secrets logic classes which handle
# the core secret management functionality of the application.
#
# We test:
# 1. Secret creation (ConcealSecret)
# 2. Secret viewing (ShowSecret, RevealSecret)
# 3. Secret metadata (ShowMetadata, ListMetad... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/01_logic_base_try.rb | tests/unit/ruby/try/60_logic/01_logic_base_try.rb | # tests/unit/ruby/try/60_logic/01_logic_base_try.rb
# These tests cover the core functionality of the Logic::Base class,
# which serves as the foundation for all logic classes in the application.
#
# We test:
# 1. Initialization and parameter processing
# 2. Email validation
# 3. Plan handling
# 4. Action limiting
# 5... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/21_logic_secrets_show_metadata_try.rb | tests/unit/ruby/try/60_logic/21_logic_secrets_show_metadata_try.rb | # tests/unit/ruby/try/60_logic/21_logic_secrets_show_metadata_try.rb
# These tryouts test the ShowMetadata logic functionality in the Onetime application,
# with a focus on the initialization process and its arguments.
# They cover:
#
# 1. Creating and initializing a ShowMetadata logic with various arguments
# 2. Test... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/40_logic_domains_try.rb | tests/unit/ruby/try/60_logic/40_logic_domains_try.rb | # tests/unit/ruby/try/60_logic/40_logic_domains_try.rb
# NOTE: Domain logic is only in V2. V1 includes domains that are related
# to secrets but otherwise does not have domains funtionality.
# These tests cover the Domains logic classes which handle
# custom domain management functionality.
#
# We test:
# 1. Domain a... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/22_logic_secrets_show_secret_try.rb | tests/unit/ruby/try/60_logic/22_logic_secrets_show_secret_try.rb | # tests/unit/ruby/try/60_logic/22_logic_secrets_show_secret_try.rb
# These tryouts test the ShowSecret logic functionality in the Onetime application,
# with a focus on the initialization process and its arguments.
# They cover:
#
# 1. Creating and initializing a ShowSecret logic with various arguments
# 2. Testing th... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/41_logic_domains_add_try.rb | tests/unit/ruby/try/60_logic/41_logic_domains_add_try.rb | # tests/unit/ruby/try/60_logic/41_logic_domains_add_try.rb
# NOTE: Domain logic is only in V2. V1 includes domains that are related
# to secrets but otherwise does not have domains funtionality.
# These tests cover the Domains logic classes which handle
# custom domain management functionality.
#
# We test:
# 1. Doma... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/02_logic_base_try.rb | tests/unit/ruby/try/60_logic/02_logic_base_try.rb | # tests/unit/ruby/try/60_logic/02_logic_base_try.rb
# These tryouts test the base logic of the Onetime application,
# specifically focusing on the CreateAccount functionality.
#
# We're testing various aspects of the CreateAccount logic, including:
# 1. Instance creation
# 2. Email validation
#
# These tests aim to en... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/23_logic_secrets_reveal_secret_try.rb | tests/unit/ruby/try/60_logic/23_logic_secrets_reveal_secret_try.rb | # tests/unit/ruby/try/60_logic/23_logic_secrets_reveal_secret_try.rb
# These tryouts test the RevealSecret logic functionality in the Onetime application,
# with a focus on the initialization process and its arguments.
# They cover:
#
# 1. Creating and initializing a RevealSecret logic with various arguments
# 2. Test... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/02_logic_authentication_try.rb | tests/unit/ruby/try/60_logic/02_logic_authentication_try.rb | # tests/unit/ruby/try/60_logic/02_logic_authentication_try.rb
# These tests cover the Authentication logic classes which handle
# session management, password resets, and user authentication.
#
# We test:
# 1. Session authentication
# 2. Password reset requests
# 3. Password reset confirmation
# 4. Session destruction... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/60_incoming/02_validate_recipient_try.rb | tests/unit/ruby/try/60_logic/60_incoming/02_validate_recipient_try.rb | # tests/unit/ruby/try/60_logic/60_incoming/02_validate_recipient_try.rb
# These tests cover the Incoming::ValidateRecipient logic class which handles
# validation of recipient email addresses against the allowed list.
#
# We test:
# 1. Valid recipient validation
# 2. Invalid recipient rejection
# 3. Empty recipient ha... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/60_incoming/01_get_config_try.rb | tests/unit/ruby/try/60_logic/60_incoming/01_get_config_try.rb | # tests/unit/ruby/try/60_logic/60_incoming/01_get_config_try.rb
# These tests cover the Incoming::GetConfig logic class which handles
# retrieval and filtering of incoming secrets configuration.
#
# We test:
# 1. Configuration loading when feature is enabled
# 2. Configuration loading when feature is disabled
# 3. Fil... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/60_logic/60_incoming/03_create_incoming_secret_try.rb | tests/unit/ruby/try/60_logic/60_incoming/03_create_incoming_secret_try.rb | # tests/unit/ruby/try/60_logic/60_incoming/03_create_incoming_secret_try.rb
# These tests cover the Incoming::CreateIncomingSecret logic class which handles
# creation of incoming secrets with memo and recipient metadata.
#
# We test:
# 1. Basic secret creation with all fields
# 2. Title truncation to max length
# 3. ... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/migrations/20250728-1512_02_customer_custom_domain_cleanup.rb | migrations/20250728-1512_02_customer_custom_domain_cleanup.rb | # .purgatory/migrations/core/20250728-1512_02_customer_custom_domain_cleanup.rb
#
# frozen_string_literal: true
#
# Custom Domain Cleanup - Remove test user domains
#
# Purpose: Removes custom domain records for test users:
# - Domains matching "tryouts*onetimesecret.com" pattern -> remove
# - Verifies no related cust... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/migrations/20250728-1512_00_customer_objid.rb | migrations/20250728-1512_00_customer_objid.rb | # .purgatory/migrations/core/20250728-1512_00_customer_objid.rb
#
# frozen_string_literal: true
#
# Customer Object ID (and External ID) Migration - Pipeline
#
# Purpose: Populates objid field for all existing Customer records. The extid
# field will be lazy populated on first access.
# - objid: Set to a UUIDv7 base... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/migrations/20250727-1523_02_reorganize_config_structure.rb | migrations/20250727-1523_02_reorganize_config_structure.rb | # migrations/20250727-1523_02_reorganize_config_structure.rb
#
# frozen_string_literal: true
# Migration 2 of 2: Reorganize Config Structure
#
# This migration reorganizes the config.yaml hierarchy, moving settings
# to their new locations. It expects string keys (run migration 01 first
# if you have symbol keys).
#
#... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/migrations/20250728-1512_01_customer_cleanup.rb | migrations/20250728-1512_01_customer_cleanup.rb | # migrations/20250728-1512_01_customer_cleanup.rb
#
# frozen_string_literal: true
#
# Customer Cleanup - Remove anonymous, known test users - Pipeline
#
# Purpose: Removes Customer records based on the following criteria:
# - custid: is empty, anon, or matches "tryouts*onetimesecret.com" -> remove
# - email: is empty ... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/migrations/20250727-1523_01_convert_symbol_keys.rb | migrations/20250727-1523_01_convert_symbol_keys.rb | # migrations/20250727-1523_01_convert_symbol_keys.rb
#
# frozen_string_literal: true
# Migration 1 of 2: Convert YAML Symbol Keys to Strings
#
# This migration converts YAML files that use Ruby symbol syntax for keys
# (e.g., `:key:`) to standard string keys (e.g., `key:`).
#
# **NOTE**: Uses `perl` for regex replacem... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/migrations/20250728-1512_03_session_cleanup.rb | migrations/20250728-1512_03_session_cleanup.rb | # .purgatory/migrations/core/20250728-1512_03_session_cleanup.rb
#
# frozen_string_literal: true
#
# Session Cleanup - Remove test user sessions
#
# Purpose: Removes session records with no expiration
# - Sessions without a TTL were created by a bug. They never expire so
# they are never cleaned up.
# - Verifies the... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/chimera.rb | lib/chimera.rb | # lib/chimera.rb
require 'mustache'
class Chimera < Mustache
self.template_extension = 'html'
# Class instance variables with class << self
class << self
attr_reader :partial_caching_enabled, :partial_cache
def enable_partial_caching
@partial_caching_enabled = true
end
def... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/stathat.rb | lib/stathat.rb | # lib/stathat.rb
require 'net/http'
require 'uri'
module StatHat
class API
def self.post_value(stat_key, user_key, value)
args = { :key => stat_key,
:ukey => user_key,
:value => value }
resp = Net::HTTP.post_form(URI.parse("http://api.stathat.com/v"), args)
return self.response... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime.rb | lib/onetime.rb | # lib/onetime.rb
require 'bundler/setup'
require 'securerandom'
require 'truemail'
require 'erb'
require 'encryptor'
require 'bcrypt'
require 'sendgrid-ruby'
require 'rack'
require 'otto'
require 'gibbler/mixins'
require 'familia'
require 'storable'
require_relative 'onetime/core_ext'
# Ensure immediate flushin... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/middleware/handle_invalid_utf8.rb | lib/middleware/handle_invalid_utf8.rb |
require 'json'
require 'logger'
require 'rack'
# Rack::HandleInvalidUTF8
#
# Handles invalid UTF8 characters in request URI and headers by
# raising an exception and returning a 400 Bad Request response.
#
class Rack::HandleInvalidUTF8
@default_content_type = 'application/json'
@default_charset = 'utf-8'
@... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/middleware/detect_host.rb | lib/middleware/detect_host.rb | module Rack
require 'ipaddr'
# Middleware to accurately detect the client's host in a Rack application.
#
# This middleware examines incoming HTTP requests and attempts to determine
# the correct host by inspecting a prioritized list of HTTP headers. While
# Rack's default `req.host` method provides basic... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/middleware/clear_session_messages.rb | lib/middleware/clear_session_messages.rb | require 'logger'
module Rack
# ClearSessionMessages: Clears session messages after a successful response.
#
# This middleware operates on the response, not affecting requests or errors.
class ClearSessionMessages
attr_reader :logger
def initialize(app, io: $stderr)
@app = app
@logger = ::L... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/middleware/header_logger_middleware.rb | lib/middleware/header_logger_middleware.rb | # lib/middleware/header_logger_middleware.rb
#
# frozen_string_literal: true
require 'logger'
# Rack::HeaderLoggerMiddleware
#
# Logs all HTTP headers for each request to the system log.
# It is intended for use in development environments. It is not recommended for
# production use, as it will log sensitive informat... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/middleware/handle_invalid_percent_encoding.rb | lib/middleware/handle_invalid_percent_encoding.rb |
require 'json'
require 'logger'
require 'rack'
# Rack::HandleInvalidPercentEncoding
#
# This middleware addresses the challenge of handling malformed percent-encoded
# data in HTTP requests. Instead of attempting to guess or fix invalid encodings,
# which could lead to silent but deadly data corruption, it:
#
# 1. D... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers.rb | lib/onetime/initializers.rb | # lib/onetime/initializers.rb
require_relative 'initializers/boot'
require_relative 'initializers/set_global_secret' # TODO: Combine into
require_relative 'initializers/set_rotated_secrets' # set_secrets
require_relative 'initializers/load_locales'
require_relative 'initializers/check_redis_url'
require_relative 'in... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/cluster.rb | lib/onetime/cluster.rb | require 'httparty'
module Onetime
module Cluster
# Features is a module for storing cluster-specific information.
#
# It is used to store information about the cluster type, API key, cluster IP,
# and cluster name.
#
#
# Reminder: when running in dev-mode (or any hot-reload environment), ... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/version.rb | lib/onetime/version.rb | # lib/onetime/version.rb
#
# frozen_string_literal: true
require 'json'
module Onetime
module VERSION
def self.to_a
load_config
[@version[:MAJOR], @version[:MINOR], @version[:PATCH]]
end
def self.to_s
version = to_a.join('.')
version = "#{version}-#{@version[:PRE]}" if @version[... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/core_ext.rb | lib/onetime/core_ext.rb |
module QuantizeTime
def quantize quantum
stamp = self.is_a?(Integer) ? self : to_i
Time.at(stamp - (stamp % quantum)).utc
end
def on_the_next quantum
Time.at(quantize(quantum)+quantum).utc
end
end
module QuantizeInteger
def quantize quantum
stamp = self.is_a?(Integer) ? self : to_i
sta... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/errors.rb | lib/onetime/errors.rb |
module Onetime
# The Problem class inherits from RuntimeError, which is a subclass of StandardError.
# Both RuntimeError and StandardError are standard exception classes in Ruby, but
# RuntimeError is used for errors that are typically caused by the program's logic
# and are usually rescued implicitly (e.g.,... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/middleware.rb | lib/onetime/middleware.rb | # lib/onetime/middleware.rb
require 'logger'
require_relative '../middleware/clear_session_messages'
require_relative '../middleware/header_logger_middleware'
require_relative '../middleware/handle_invalid_percent_encoding'
require_relative '../middleware/handle_invalid_utf8'
require_relative '../middleware/detect_hos... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/utils.rb | lib/onetime/utils.rb |
require 'httparty'
module Onetime
module Utils
extend self
attr_accessor :fortunes
unless defined?(VALID_CHARS)
# Symbols used in character sets for random string generation.
# Includes common special characters that are generally safe for use
# in generated identifiers and passwords... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/views.rb | lib/onetime/views.rb | # lib/onetime/views.rb
require 'core/views'
| ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/controllers.rb | lib/onetime/controllers.rb | # lib/onetime/controllers.rb
require 'v1/controllers'
require 'v2/controllers'
require 'core/controllers'
| ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/console.rb | lib/onetime/console.rb | # lib/onetime/console.rb
ENV['RACK_ENV'] ||= 'production'
ENV['ONETIME_HOME'] = File.expand_path(File.join(__dir__, '..', '..')).freeze
app_root = ENV['ONETIME_HOME']
# Directory Constants
unless defined?(PUBLIC_DIR)
PUBLIC_DIR = File.join(app_root, '/public/web').freeze
APP_DIR = File.join(app_root, '/apps').fre... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/plan.rb | lib/onetime/plan.rb |
module Onetime
class Plan
extend Familia::Features::SafeDump::ClassMethods
@safe_dump_fields = [
{ :identifier => ->(obj) { obj.planid } },
:planid, :price, :discount, :options
]
attr_reader :planid, :price, :discount, :options
def initialize(planid, price, discount, options = {})
... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/models.rb | lib/onetime/models.rb | # lib/onetime/models.rb
# This file serves as a central loading point for all model classes across
# different API versions. It provides a convenient way for external code to
# access model classes without needing to understand the underlying version
# structure.
#
# The CURRENT_API_VERSION constant allows test suites... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/indifferent_hash.rb | lib/onetime/indifferent_hash.rb | # lib/onetime/indifferent_hash.rb
#
# frozen_string_literal: true
module Onetime
# Hash subclass providing indifferent access (symbol or string keys)
# Used to wrap configuration loaded from YAML files.
#
# PURPOSE: Temporary compatibility layer for main branch migration.
# Allows existing symbol-key config ... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/classmethods.rb | lib/onetime/classmethods.rb | # lib/onetime/classmethods.rb
# Usage:
# module Onetime
# extend EnvironmentHelper
# end
#
# Environment detection and normalization
module Onetime
module ClassMethods
@env = nil
@mode = :app
@debug = nil
attr_accessor :mode, :env
attr_writer :debug
# Returns the normalized application en... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/cli.rb | lib/onetime/cli.rb | # lib/onetime/cli.rb
require 'drydock'
require 'onetime'
require 'familia/tools'
require 'onetime/migration'
require 'v2/models'
require 'v2/logic'
# Load CLI commands
require_relative 'cli/change_email'
module Onetime
class CLI < Drydock::Command
def init
# Make sure all the models are loaded before ca... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/config.rb | lib/onetime/config.rb | # lib/onetime/config.rb
require_relative 'indifferent_hash'
module Onetime
module Config
extend self
unless defined?(SERVICE_PATHS)
SERVICE_PATHS = %w[/etc/onetime ./etc].freeze
UTILITY_PATHS = %w[~/.onetime /etc/onetime ./etc].freeze
DEFAULTS = {
site: {
secret: nil,
... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/mail.rb | lib/onetime/mail.rb | # lib/onetime/mail.rb
require_relative 'mail/views'
require_relative 'mail/mailer/base_mailer'
require_relative 'mail/mailer/smtp_mailer'
require_relative 'mail/mailer/sendgrid_mailer'
require_relative 'mail/mailer/ses_mailer'
module Onetime
module Mail
@mailer = nil
# Returns the configured mailer instan... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/alias.rb | lib/onetime/alias.rb | # lib/onetime/alias.rb
# typed: ignore
# This file exists solely to define the OT = Onetime constant.
# Defining this constant in onetime.rb file triggers Sorbet error
# 4022. To avoid this error and maintain type safety, we move the
# definition to this file which we can set to typed: ignore.
#
# lib/onetime/cli.r... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/migration.rb | lib/onetime/migration.rb | # lib/onetime/migration.rb
#
# frozen_string_literal: true
require_relative 'migration/base_migration'
require_relative 'migration/model_migration'
require_relative 'migration/pipeline_migration'
| ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/logic.rb | lib/onetime/logic.rb | # lib/onetime/logic.rb
require 'v1/logic'
require 'v2/logic'
| ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/load_fortunes.rb | lib/onetime/initializers/load_fortunes.rb | # /Users/d/Projects/opensource/onetime/onetimesecret/lib/onetime/initializers/load_fortunes.rb
# lib/onetime/initializers/load_fortunes.rb
module Onetime
module Initializers
def load_fortunes
OT::Utils.fortunes ||= File.readlines(File.join(Onetime::HOME, 'etc', 'fortunes'))
end
end
end
| ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/setup_diagnostics.rb | lib/onetime/initializers/setup_diagnostics.rb | # lib/onetime/initializers/setup_diagnostics.rb
require 'openssl'
module Onetime
module Initializers
# d9s: diagnostics is a boolean flag. If true, it will enable Sentry
attr_accessor :d9s_enabled
def setup_diagnostics
OT.d9s_enabled = conf[:diagnostics][:enabled] || false
return unless OT... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/load_locales.rb | lib/onetime/initializers/load_locales.rb | # lib/onetime/initializers/load_locales.rb
require 'json'
module Onetime
module Initializers
@i18n_enabled = false
attr_reader :i18n_enabled, :locales, :supported_locales, :default_locale, :fallback_locale
# We always load locales regardless of whether internationalization
# is enabled. When it's ... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/detect_legacy_data_and_warn.rb | lib/onetime/initializers/detect_legacy_data_and_warn.rb | # lib/onetime/initializers/detect_legacy_data_and_warn.rb
#
# frozen_string_literal: true
module Onetime
module Initializers
# DetectLegacyDataAndWarn initializer
#
# Checks for legacy data distribution across multiple Redis databases before
# connecting to databases. This initializer performs side-e... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/check_redis_url.rb | lib/onetime/initializers/check_redis_url.rb | # lib/onetime/initializers/check_redis_url.rb
module Onetime
module Initializers
# Validates that the Redis/Valkey URL is properly configured and does not
# contain placeholder values. This fail-fast check prevents confusing
# downstream errors like "Cannot connect to redis redis://CHANGEME@..."
#
... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/configure_truemail.rb | lib/onetime/initializers/configure_truemail.rb | # lib/onetime/initializers/configure_truemail.rb
module Onetime
module Initializers
def configure_truemail
truemail_config = Onetime.conf[:mail][:truemail]
# Iterate over the keys in the mail/truemail config
# and set the corresponding key in the Truemail config.
# Note: IndifferentHash... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/setup_incoming_recipients.rb | lib/onetime/initializers/setup_incoming_recipients.rb | # frozen_string_literal: true
require 'digest/sha2'
module Onetime
module Initializers
# Sets up recipient hashing for the incoming secrets feature.
# Processes raw email addresses from config and creates:
# 1. A lookup table mapping hashes to emails (for backend)
# 2. Public recipient list with ha... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/setup_system_settings.rb | lib/onetime/initializers/setup_system_settings.rb | # lib/onetime/initializers/setup_system_settings.rb
module Onetime
module Initializers
@first_boot = nil
# Sets up system settings by checking for existing override
# configuration in Redis and merging it with YAML configuration.
# Creates initial system settings record on first boot.
#
def ... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/prepare_emailers.rb | lib/onetime/initializers/prepare_emailers.rb | # lib/onetime/initializers/prepare_emailers.rb
module Onetime
module Initializers
attr_reader :emailer
# Prepares the emailer based on the configured mode.
#
# This method retrieves the Redis database configurations from the application
# settings and establishes connections for each model class... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/setup_authentication.rb | lib/onetime/initializers/setup_authentication.rb | # lib/onetime/initializers/setup_authentication.rb
module Onetime
module Initializers
def setup_authentication
end
end
end
| ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/print_log_banner.rb | lib/onetime/initializers/print_log_banner.rb | # lib/onetime/initializers/print_log_banner.rb
require 'tty-table'
require 'json'
module Onetime
module Initializers
# Prints a formatted banner with system and configuration information at startup.
# The banner is organized into logical sections, each rendered as a table.
#
# Structure:
# - Al... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/configure_domains.rb | lib/onetime/initializers/configure_domains.rb | # lib/onetime/initializers/configure_domains.rb
module Onetime
module Initializers
def configure_domains
is_enabled = conf.dig(:site, :domains, :enabled).to_s == "true"
return unless is_enabled
cluster = conf.dig(:site, :domains, :cluster)
OT.ld "Setting OT::Cluster::Features #{cluster}... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/load_plans.rb | lib/onetime/initializers/load_plans.rb | # /Users/d/Projects/opensource/onetime/onetimesecret/lib/onetime/initializers/load_plans.rb
# lib/onetime/initializers/load_plans.rb
module Onetime
module Initializers
def load_plans
OT::Plan.load_plans!
end
end
end
| ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/check_global_banner.rb | lib/onetime/initializers/check_global_banner.rb | # /Users/d/Projects/opensource/onetime/onetimesecret/lib/onetime/initializers/check_global_banner.rb
# lib/onetime/initializers/check_global_banner.rb
module Onetime
module Initializers
attr_reader :global_banner
def check_global_banner
@global_banner = Familia.redis(0).get('global_banner')
OT.li... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/connect_databases.rb | lib/onetime/initializers/connect_databases.rb | # lib/onetime/initializers/connect_databases.rb
require_relative '../refinements/horreum_refinements'
module Onetime
module Initializers
using Familia::HorreumRefinements
# Connects each model to its configured Redis database.
#
# This method retrieves the Redis database configurations from the ap... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/set_rotated_secrets.rb | lib/onetime/initializers/set_rotated_secrets.rb | # lib/onetime/initializers/set_rotated_secrets.rb
module Onetime
module Initializers
attr_reader :rotated_secrets
def set_rotated_secrets
# Remove nil elements that have inadvertently been set in
# the list of previously used global secrets. Happens easily
# when using environment vars in... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/boot.rb | lib/onetime/initializers/boot.rb | # lib/onetime/initializers/boot.rb
require 'sysinfo'
module Onetime
module Initializers
@sysinfo = nil
@conf = nil
attr_reader :conf, :instance, :sysinfo
# Boot reads and interprets the configuration and applies it to the
# relevant features and services. Must be called after applications
... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/initializers/set_global_secret.rb | lib/onetime/initializers/set_global_secret.rb | # lib/onetime/initializers/set_global_secret.rb
module Onetime
module Initializers
attr_reader :global_secret
def set_global_secret
@global_secret = OT.conf[:site][:secret] || nil
unless Gibbler.secret && Gibbler.secret.frozen?
Gibbler.secret = global_secret.freeze
end
end
en... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/services/change_email.rb | lib/onetime/services/change_email.rb | # lib/onetime/services/change_email.rb
module Onetime
module Services
# Service class for managing customer email address changes.
#
# This service handles the complex process of changing a customer's email address,
# which involves updating multiple Redis keys and maintaining relationships
# bet... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/mail/views.rb | lib/onetime/mail/views.rb | # lib/onetime/mail/views.rb
require_relative 'views/common'
| ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/mail/mailer/smtp_mailer.rb | lib/onetime/mail/mailer/smtp_mailer.rb | # lib/onetime/mail/mailer/smtp_mailer.rb
require 'mail' # gem 'mail', here referred to as ::Mail
require_relative 'base_mailer'
module Onetime::Mail
module Mailer
class SMTPMailer < BaseMailer
def send_email(to_address, subject, html_content, text_content) # rubocop:disable Metrics/MethodLength
... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/mail/mailer/base_mailer.rb | lib/onetime/mail/mailer/base_mailer.rb | # lib/onetime/mail/mailer/base_mailer.rb
module Onetime
module Mail
module Mailer
class BaseMailer
attr_accessor :reply_to
attr_reader :from, :fromname
def initialize(from, fromname, reply_to=nil)
OT.ld "[mail-init] from:#{from}, fromname:#{fromname}, reply-to:#{reply_to... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/mail/mailer/ses_mailer.rb | lib/onetime/mail/mailer/ses_mailer.rb | # lib/onetime/mail/mailer/ses_mailer.rb
require 'aws-sdk-sesv2'
require_relative 'base_mailer'
module Onetime::Mail
module Mailer
class SESMailer < BaseMailer
def send_email(to_address, subject, html_content, text_content)
mailer_response = nil
obscured_address = OT::Utils.obscure_email(t... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/mail/mailer/sendgrid_mailer.rb | lib/onetime/mail/mailer/sendgrid_mailer.rb | # lib/onetime/mail/mailer/sendgrid_mailer.rb
require 'sendgrid-ruby'
require_relative 'base_mailer'
module Onetime::Mail
module Mailer
class SendGridMailer < BaseMailer
include SendGrid
def send_email(to_address, subject, html_content, text_content, test_mode=false)
mailer_response = nil
... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/mail/views/common.rb | lib/onetime/mail/views/common.rb | # lib/onetime/mail/views/common.rb
require 'mustache'
require_relative 'base'
module Onetime
module Mail
class Welcome < Mail::Views::Base
def init secret
self[:secret] = secret
self[:email_address] = cust.email
end
def subject
i18n[:email][:subject]
end
... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/mail/views/view_helpers.rb | lib/onetime/mail/views/view_helpers.rb | # lib/onetime/mail/views/view_helpers.rb
module Onetime
module Mail
module ViewHelpers # rubocop:disable Style/Documentation
end
end
end
| ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/mail/views/base.rb | lib/onetime/mail/views/base.rb | # lib/onetime/mail/views/base.rb
require 'chimera'
require_relative 'view_helpers'
module Onetime
module Mail
module Views
class Base < Chimera
include Mail::ViewHelpers
self.template_path = './templates/mail'
self.view_namespace = Onetime::Mail
self.view_path = './onetim... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/helpers/homepage_mode_helpers.rb | lib/onetime/helpers/homepage_mode_helpers.rb | # frozen_string_literal: true
require 'ipaddr'
module Onetime
module Helpers
# Homepage Mode Detection
#
# Determines which homepage experience to show based on CIDR matching
# and request header fallback. This module provides IP-based detection
# with privacy-preserving CIDR validation.
#
... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/middleware/security.rb | lib/onetime/middleware/security.rb | # lib/onetime/middleware/security.rb
#
# Security middleware collection for the Onetime Secret application.
# Configures various Rack::Protection middleware components based on
# application configuration settings.
require 'rack'
require 'rack/protection'
require 'rack/utf8_sanitizer'
module Onetime
module Middlewa... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/middleware/static_files.rb | lib/onetime/middleware/static_files.rb | # lib/onetime/middleware/static_files.rb
#
# Static file serving middleware for the Onetime Secret application.
# Provides static file serving capabilities which can be used when
# running without a reverse proxy.
require 'rack'
module Onetime
module Middleware
# Static file serving middleware for Onetime Secre... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/middleware/vite_proxy.rb | lib/onetime/middleware/vite_proxy.rb | # lib/onetime/middleware/vite_proxy.rb
#
# Development proxy middleware for Onetime Secret application.
# Provides development-specific utilities including Vite integration.
require 'rack'
module Onetime
module Middleware
# Development environment middleware for Onetime Secret
#
# This middleware handle... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/middleware/domain_strategy.rb | lib/onetime/middleware/domain_strategy.rb | # lib/onetime/middleware/domain_strategy.rb
require 'public_suffix'
module Onetime
# Domain Strategy Middleware
#
# Normalizes incoming request domains and classifies them into strategies:
# :canonical - Exact match with configured domain (example.com)
# :subdomain - Valid subdomain of canonical domai... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/migration/model_migration.rb | lib/onetime/migration/model_migration.rb | # lib/onetime/migration/model_migration.rb
#
# frozen_string_literal: true
require_relative 'base_migration'
# Familia v1 compatibility layer for v2 methods
#
# This module provides backward compatibility when running migrations
# in main which uses Familia v1 API, while the migration framework
# uses Familia v2 met... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/migration/pipeline_migration.rb | lib/onetime/migration/pipeline_migration.rb | # lib/onetime/migration/pipeline_migration.rb
#
# frozen_string_literal: true
require_relative 'model_migration'
module Onetime
# Pipeline-based migration for batch Redis operations with improved performance
#
# Inherits all ModelMigration functionality but processes records in batches
# using Redis pipelinin... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/migration/base_migration.rb | lib/onetime/migration/base_migration.rb | # lib/onetime/migration/base_migration.rb
#
# frozen_string_literal: true
require 'onetime'
unless defined?(APPS_ROOT)
APPS_ROOT = File.join(OT::HOME, 'apps').freeze
$LOAD_PATH.unshift(File.join(APPS_ROOT, 'api'))
$LOAD_PATH.unshift(File.join(APPS_ROOT, 'web'))
end
require 'onetime/models'
module Onetime
# ... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/cli/change_email.rb | lib/onetime/cli/change_email.rb | # lib/onetime/cli/change_email.rb
module Onetime
class CLI < Drydock::Command
# CLI command to view email change reports
def change_email
# Default limit is 10 reports, can be overridden with --limit or -n option
limit = option.limit || 10
email_filter = argv.first
puts "Viewing rece... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/refinements/rack_refinements.rb | lib/onetime/refinements/rack_refinements.rb | # lib/onetime/refinements/rack_refinements.rb
module Onetime
module RackRefinements
refine Hash do
def fetch(key, *args)
string_key = key.to_s
symbol_key = key.respond_to?(:to_sym) ? key.to_sym : nil
return super(string_key, *args) if key?(string_key)
return super(symbol_key... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/refinements/uuidv7_refinements.rb | lib/onetime/refinements/uuidv7_refinements.rb | # lib/onetime/refinements/uuidv7_refinements.rb
module Onetime
# UUIDv7 Refinements for SecureRandom, String, and Time
#
# Usage:
#
# using Onetime::UUIDv7Refinements
#
# uuid = SecureRandom.uuid_v7
# time = SecureRandom.extract_time_from_uuid_v7(uuid)
# timestamp = SecureRandom.time_to_uuid_... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/refinements/stripe_refinements.rb | lib/onetime/refinements/stripe_refinements.rb | # lib/onetime/refinements/stripe_refinements.rb
require 'stripe' # ensures Stripe namespace is loaded
module Onetime::StripeRefinements
refine Stripe::Subscription do
extend Familia::Features::SafeDump::ClassMethods
# Safe fields for Stripe Subscription object
set_safe_dump_fields [
{ :identifier... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
onetimesecret/onetimesecret | https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/lib/onetime/refinements/horreum_refinements.rb | lib/onetime/refinements/horreum_refinements.rb | # lib/onetime/refinements/horreum_refinements.rb
module Familia
module HorreumRefinements
refine Familia::Horreum.singleton_class do
# Converts the class name into a symbol that can be used to look up
# configuration values. This is particularly useful when mapping
# database numbers to specifi... | ruby | MIT | c58548274ad44e644295258a31d5d2f81aaffc15 | 2026-01-04T15:53:41.320614Z | false |
collabnix/kubelabs | https://github.com/collabnix/kubelabs/blob/d43118c4af2adeb708d26658615319d6493e6077/.bundles_cache/ruby/2.6.0/gems/jekyll-sitemap-1.4.0/spec/test_jekyll-last-modified-at.rb | .bundles_cache/ruby/2.6.0/gems/jekyll-sitemap-1.4.0/spec/test_jekyll-last-modified-at.rb | # frozen_string_literal: true
require "spec_helper"
describe(Jekyll::JekyllSitemap) do
let(:overrides) do
{
"source" => source_dir,
"destination" => dest_dir,
"url" => "http://example.org",
"collections" => {
"my_collection" => { "output" => true },
"other_th... | ruby | Apache-2.0 | d43118c4af2adeb708d26658615319d6493e6077 | 2026-01-04T15:51:47.325668Z | false |
collabnix/kubelabs | https://github.com/collabnix/kubelabs/blob/d43118c4af2adeb708d26658615319d6493e6077/.bundles_cache/ruby/2.6.0/gems/jekyll-sitemap-1.4.0/spec/jekyll-sitemap_spec.rb | .bundles_cache/ruby/2.6.0/gems/jekyll-sitemap-1.4.0/spec/jekyll-sitemap_spec.rb | # frozen_string_literal: true
require "spec_helper"
describe(Jekyll::JekyllSitemap) do
let(:overrides) do
{
"source" => source_dir,
"destination" => dest_dir,
"url" => "http://example.org",
"collections" => {
"my_collection" => { "output" => true },
"other_th... | ruby | Apache-2.0 | d43118c4af2adeb708d26658615319d6493e6077 | 2026-01-04T15:51:47.325668Z | false |
collabnix/kubelabs | https://github.com/collabnix/kubelabs/blob/d43118c4af2adeb708d26658615319d6493e6077/.bundles_cache/ruby/2.6.0/gems/jekyll-sitemap-1.4.0/spec/spec_helper.rb | .bundles_cache/ruby/2.6.0/gems/jekyll-sitemap-1.4.0/spec/spec_helper.rb | # frozen_string_literal: true
require "jekyll"
require "fileutils"
require File.expand_path("../lib/jekyll-sitemap", __dir__)
Jekyll.logger.log_level = :error
RSpec.configure do |config|
config.run_all_when_everything_filtered = true
config.filter_run :focus
config.order = "random"
SOURCE_DIR = File.expand_... | ruby | Apache-2.0 | d43118c4af2adeb708d26658615319d6493e6077 | 2026-01-04T15:51:47.325668Z | false |
collabnix/kubelabs | https://github.com/collabnix/kubelabs/blob/d43118c4af2adeb708d26658615319d6493e6077/.bundles_cache/ruby/2.6.0/gems/jekyll-sitemap-1.4.0/lib/jekyll-sitemap.rb | .bundles_cache/ruby/2.6.0/gems/jekyll-sitemap-1.4.0/lib/jekyll-sitemap.rb | # frozen_string_literal: true
require "jekyll/page_without_a_file"
require "jekyll/jekyll-sitemap"
| ruby | Apache-2.0 | d43118c4af2adeb708d26658615319d6493e6077 | 2026-01-04T15:51:47.325668Z | false |
collabnix/kubelabs | https://github.com/collabnix/kubelabs/blob/d43118c4af2adeb708d26658615319d6493e6077/.bundles_cache/ruby/2.6.0/gems/jekyll-sitemap-1.4.0/lib/jekyll-sitemap/version.rb | .bundles_cache/ruby/2.6.0/gems/jekyll-sitemap-1.4.0/lib/jekyll-sitemap/version.rb | # frozen_string_literal: true
module Jekyll
module Sitemap
VERSION = "1.4.0"
end
end
| ruby | Apache-2.0 | d43118c4af2adeb708d26658615319d6493e6077 | 2026-01-04T15:51:47.325668Z | false |
collabnix/kubelabs | https://github.com/collabnix/kubelabs/blob/d43118c4af2adeb708d26658615319d6493e6077/.bundles_cache/ruby/2.6.0/gems/jekyll-sitemap-1.4.0/lib/jekyll/page_without_a_file.rb | .bundles_cache/ruby/2.6.0/gems/jekyll-sitemap-1.4.0/lib/jekyll/page_without_a_file.rb | # frozen_string_literal: true
module Jekyll
class PageWithoutAFile < Page
# rubocop:disable Naming/MemoizedInstanceVariableName
def read_yaml(*)
@data ||= {}
end
# rubocop:enable Naming/MemoizedInstanceVariableName
end
end
| ruby | Apache-2.0 | d43118c4af2adeb708d26658615319d6493e6077 | 2026-01-04T15:51:47.325668Z | false |
collabnix/kubelabs | https://github.com/collabnix/kubelabs/blob/d43118c4af2adeb708d26658615319d6493e6077/.bundles_cache/ruby/2.6.0/gems/jekyll-sitemap-1.4.0/lib/jekyll/jekyll-sitemap.rb | .bundles_cache/ruby/2.6.0/gems/jekyll-sitemap-1.4.0/lib/jekyll/jekyll-sitemap.rb | # frozen_string_literal: true
require "fileutils"
module Jekyll
class JekyllSitemap < Jekyll::Generator
safe true
priority :lowest
# Main plugin action, called by Jekyll-core
def generate(site)
@site = site
@site.pages << sitemap unless file_exists?("sitemap.xml")
@site.pages << r... | ruby | Apache-2.0 | d43118c4af2adeb708d26658615319d6493e6077 | 2026-01-04T15:51:47.325668Z | false |
collabnix/kubelabs | https://github.com/collabnix/kubelabs/blob/d43118c4af2adeb708d26658615319d6493e6077/.bundles_cache/ruby/2.6.0/gems/jekyll-seo-tag-2.8.0/.github/workflows/scripts/memprof.rb | .bundles_cache/ruby/2.6.0/gems/jekyll-seo-tag-2.8.0/.github/workflows/scripts/memprof.rb | # frozen_string_literal: true
require 'jekyll'
require 'memory_profiler'
MemoryProfiler.report(allow_files: 'lib/jekyll-seo-tag') do
Jekyll::PluginManager.require_from_bundler
Jekyll::Commands::Build.process({
"source" => File.expand_path(ARGV[0]),
"destination" => File.expand_path("#{A... | ruby | Apache-2.0 | d43118c4af2adeb708d26658615319d6493e6077 | 2026-01-04T15:51:47.325668Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.