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/apps/web/core/views/serializers/system_serializer.rb
apps/web/core/views/serializers/system_serializer.rb
# apps/web/core/views/serializers/system_serializer.rb module Core module Views # Serializes system-level information for the frontend # # Responsible for transforming application version, runtime information, # and security-related values for frontend consumption. module SystemSerializer ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/apps/web/core/views/serializers/messages_serializer.rb
apps/web/core/views/serializers/messages_serializer.rb
# apps/web/core/views/serializers/messages_serializer.rb module Core module Views # Serializes flash messages and global notifications for the frontend # # Responsible for transforming user-facing messages, notifications, # and global banners for frontend display. module MessagesSerializer ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/apps/web/core/views/serializers/domain_serializer.rb
apps/web/core/views/serializers/domain_serializer.rb
# apps/web/core/views/serializers/domain_serializer.rb require 'v2/models/custom_domain' require 'onetime/middleware/domain_strategy' module Core module Views # Serializes domain-related information for the frontend # # Handles custom domains, domain strategies, and domain branding # transformation...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/apps/web/core/views/helpers/vite_manifest.rb
apps/web/core/views/helpers/vite_manifest.rb
# apps/web/core/views/helpers/vite_manifest.rb module Core module Views # ViteManifest handles asset loading for Vite-managed frontend assets. # # This module loads JavaScript, CSS, and font assets based on the Vite manifest, # supporting both production and development configurations. It handles the...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/apps/web/core/views/helpers/sanitizer.rb
apps/web/core/views/helpers/sanitizer.rb
# apps/web/core/views/helpers/sanitizer.rb # SanitizerHelpers provides methods for sanitizing data before rendering in views. # # This module handles JSON serialization, HTML escaping, and caching to prevent # common security issues like XSS attacks and ensure proper data rendering. # module Core module Views mo...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/apps/web/core/views/helpers/i18n.rb
apps/web/core/views/helpers/i18n.rb
# apps/web/core/views/helpers/i18n.rb # I18nHelpers provides localization functionality for view templates. # # This module implements a caching mechanism for translations with # fallback behavior when requested locales aren't available. # # @example # include Core::Views::I18nHelpers # # # Access translations # ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/apps/web/core/views/helpers/initialize_view_vars.rb
apps/web/core/views/helpers/initialize_view_vars.rb
# apps/web/core/views/helpers/initialize_view_vars.rb module Core module Views # InitializeViewVars # # This module is meant to be extended and not included. That's why # initialize_view_vars takes the arguments it does instead of relying on # instance variables and their attr_reader methods. ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/spec_helper.rb
tests/unit/ruby/rspec/spec_helper.rb
# tests/unit/ruby/rspec/onetime/config/spec_helper.rb require 'rspec' require 'yaml' require 'tempfile' require 'fileutils' # require 'fakeredis' base_path = File.expand_path('../../../../..', __FILE__) apps_root = File.join(base_path, 'apps').freeze # Add the apps dirs to the load path. This allows us to require # ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/support/model_test_helper.rb
tests/unit/ruby/rspec/support/model_test_helper.rb
# tests/unit/ruby/rspec/support/model_test_helper.rb module ModelTestHelper # Factory method to create a fully stubbed V1::Secret instance def create_stubbed_secret(attributes = {}) secret = V1::Secret.new # Apply default test attributes default_attrs = { key: "test-secret-key-#{SecureRandom.hex...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/support/mail_context.rb
tests/unit/ruby/rspec/support/mail_context.rb
# tests/unit/ruby/rspec/support/mail_context.rb def with_emailer(mail) mail.tap { |m| m.instance_variable_set(:@emailer, mail_emailer) } end def resolve_template_path(template_name) # Start from project root (where the tests directory is) project_root = Onetime::HOME File.join(project_root, 'templates', 'mail...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/support/rack_context.rb
tests/unit/ruby/rspec/support/rack_context.rb
# tests/unit/ruby/rspec/support/rack_context.rb RSpec.shared_context "rack_test_context" do let(:rack_request) do instance_double(Rack::Request, params: {}, get?: false, post?: false, path_info: '/test', env: { 'REMOTE_ADDR' => '127.0.0.1', 'HTTP_HOST' => 'example.co...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/support/view_context.rb
tests/unit/ruby/rspec/support/view_context.rb
# tests/unit/ruby/rspec/support/view_context.rb RSpec.shared_context "view_test_context" do let(:rack_request) do env = { 'REMOTE_ADDR' => '127.0.0.1', 'HTTP_HOST' => 'example.com', 'rack.session' => {}, 'ots.locale' => 'en' } # Create a properly configured double that responds t...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/support/migration_context.rb
tests/unit/ruby/rspec/support/migration_context.rb
# tests/unit/ruby/rspec/support/migration_context.rb # # Shared context for migration tests providing common setup and logging suppression # RSpec.shared_context "migration_test_context" do # Suppress migration logging during tests since we're testing logic, not output before do allow(OT).to receive(:li).and_r...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/apps/api/v1/controllers/index_spec.rb
tests/unit/ruby/rspec/apps/api/v1/controllers/index_spec.rb
# tests/unit/ruby/rspec/apps/api/v1/controllers/index_spec.rb require_relative '../../../../spec_helper' require 'v1/controllers' RSpec.describe V1::Controllers::Index, type: :request do include_context "rack_test_context" let(:request) { rack_request } let(:response) { rack_response } let(:app) { described...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/apps/api/v1/models/secret_encryption_attacks_spec.rb
tests/unit/ruby/rspec/apps/api/v1/models/secret_encryption_attacks_spec.rb
# tests/unit/ruby/rspec/apps/api/v2/models/secret_encryption_attacks_spec.rb require_relative '../../../../spec_helper' RSpec.describe V1::Secret, 'security hardening' do let(:secret) { create_stubbed_secret(key: "test-secret-key-12345") } let(:passphrase) { "secure-test-passphrase" } let(:secret_value) { "Sens...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/apps/api/v1/models/secret_encryption_alt_spec.rb
tests/unit/ruby/rspec/apps/api/v1/models/secret_encryption_alt_spec.rb
# tests/unit/ruby/rspec/apps/api/v2/models/secret_encryption_alt_spec.rb require_relative '../../../../spec_helper' RSpec.describe V1::Secret do let(:customer_id) { 'test-customer-123' } let(:token) { nil } let(:secret_value) { "This is a test secret" } let(:passphrase) { "secure-passphrase" } let(:secret_...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/apps/api/v1/models/secret_encryption_spec.rb
tests/unit/ruby/rspec/apps/api/v1/models/secret_encryption_spec.rb
# tests/unit/ruby/rspec/apps/api/v2/models/secret_encryption_spec.rb require_relative '../../../../spec_helper' RSpec.describe V1::Secret do describe 'encryption functionality' do let(:secret_value) { "This is a secret message" } let(:secret) { create_stubbed_secret(key: "test-secret-key-12345") } let(:...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/apps/api/v1/logic/secrets/base_secret_action_spec.rb
tests/unit/ruby/rspec/apps/api/v1/logic/secrets/base_secret_action_spec.rb
# tests/unit/ruby/rspec/apps/api/v1/logic/secrets/base_secret_action_spec.rb require_relative '../../../../../spec_helper' require 'v1/logic' RSpec.describe V1::Logic::Secrets::BaseSecretAction do # Create test implementation class class TestSecretAction < V1::Logic::Secrets::BaseSecretAction def process_sec...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/apps/api/v1/logic/secrets/show_secret_spec.rb
tests/unit/ruby/rspec/apps/api/v1/logic/secrets/show_secret_spec.rb
# tests/unit/ruby/rspec/apps/api/v1/logic/secrets/show_secret_spec.rb require_relative '../../../../../spec_helper' # correct depth - Mar 22 RSpec.describe V1::Logic::Secrets::ShowSecret do let(:session) { double('V1::Session') } let(:customer) { double('V1::Customer', anonymous?: false, custid: 'cust123', increm...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/apps/api/v2/application_spec.rb
tests/unit/ruby/rspec/apps/api/v2/application_spec.rb
# tests/unit/ruby/rspec/apps/api/v2/application_spec.rb require_relative '../../../spec_helper' require 'v2/application' # Attempt to test that the v2 rack app includes JSONBodyParser middleware RSpec.xdescribe V2::Application do describe 'middleware stack' do # Create mock middleware classes that might not be ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/apps/api/v2/controllers/guest_routes_helpers_spec.rb
tests/unit/ruby/rspec/apps/api/v2/controllers/guest_routes_helpers_spec.rb
# tests/unit/ruby/rspec/apps/api/v2/controllers/guest_routes_helpers_spec.rb require_relative '../../../../spec_helper' require 'v2/controllers/helpers' RSpec.describe V2::ControllerHelpers do # Create a test class that includes the helpers module let(:test_class) do Class.new do include V2::ControllerH...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/apps/api/v2/models/secret_encryption_attacks_spec.rb
tests/unit/ruby/rspec/apps/api/v2/models/secret_encryption_attacks_spec.rb
# tests/unit/ruby/rspec/apps/api/v2/models/secret_encryption_attacks_spec.rb require_relative '../../../../spec_helper' RSpec.describe V2::Secret, 'security hardening' do let(:secret) { create_stubbed_v2_secret(key: "test-secret-key-12345") } let(:passphrase) { "secure-test-passphrase" } let(:secret_value) { "S...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/apps/api/v2/models/rate_limit_spec.rb
tests/unit/ruby/rspec/apps/api/v2/models/rate_limit_spec.rb
# tests/unit/ruby/rspec/apps/api/v2/models/rate_limit_spec.rb # # Tests for V2::RateLimit model covering: # - [#2111] DEFAULT_LIMIT constant value (100) # - [#2111] event_limit string key lookup fix require_relative '../../../../spec_helper' require 'v2/models/rate_limit' RSpec.describe V2::RateLimit do # Reset reg...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/apps/api/v2/models/secret_encryption_alt_spec.rb
tests/unit/ruby/rspec/apps/api/v2/models/secret_encryption_alt_spec.rb
# tests/unit/ruby/rspec/apps/api/v2/models/secret_encryption_alt_spec.rb require_relative '../../../../spec_helper' RSpec.describe V2::Secret, allow_redis: false do let(:customer_id) { 'test-customer-123' } let(:token) { nil } let(:secret_value) { "This is a test secret" } let(:passphrase) { "secure-passphras...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/apps/api/v2/models/secret_encryption_spec.rb
tests/unit/ruby/rspec/apps/api/v2/models/secret_encryption_spec.rb
# tests/unit/ruby/rspec/apps/api/v2/models/secret_encryption_spec.rb require_relative '../../../../spec_helper' RSpec.describe V2::Secret, allow_redis: false do describe 'encryption functionality' do let(:secret_value) { "This is a secret message" } let(:secret) { create_stubbed_v2_secret(key: "test-secret-...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/apps/web/views/base_spec.rb
tests/unit/ruby/rspec/apps/web/views/base_spec.rb
# tests/unit/ruby/rspec/apps/web/views/base_spec.rb # e.g. pnpm run rspec tests/unit/ruby/rspec/apps/web/views/base_spec.rb require_relative '../../../spec_helper' require 'core/views/base' require 'core/views/serializers' RSpec.describe Core::Views::BaseView do include_context "rack_test_context" include_conte...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/apps/web/views/base_json_spec.rb
tests/unit/ruby/rspec/apps/web/views/base_json_spec.rb
# tests/unit/ruby/rspec/apps/web/views/base_json_spec.rb require_relative '../../../spec_helper' require 'json' RSpec.xdescribe Core::Views::BaseView, "JSON Output" do include_context "rack_test_context" let(:authenticated_json) do json_path = File.expand_path('../../../../support/window-authenticated.json',...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/experimental_config_spec.rb
tests/unit/ruby/rspec/onetime/experimental_config_spec.rb
# tests/unit/ruby/rspec/onetime/experimental_config_spec.rb require_relative '../spec_helper' require 'openssl' RSpec.describe "Experimental config settings" do let(:source_config_path) { File.expand_path(File.join(Onetime::HOME, 'tests', 'unit', 'ruby', 'config.test.yaml')) } describe "allow_nil_global_secret" ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/config_spec.rb
tests/unit/ruby/rspec/onetime/config_spec.rb
# tests/unit/ruby/rspec/onetime/config_spec.rb require_relative '../spec_helper' RSpec.describe Onetime::Config do describe '#apply_defaults' do let(:basic_config) do { defaults: { timeout: 5, enabled: true }, api: { timeout: 10 }, web: {}, } end let(...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/initializers/setup_diagnostics_spec.rb
tests/unit/ruby/rspec/onetime/initializers/setup_diagnostics_spec.rb
# tests/unit/ruby/rspec/onetime/initializers/setup_diagnostics_spec.rb require_relative '../../spec_helper' require 'ostruct' RSpec.describe "Onetime::Initializers#setup_diagnostics" do let(:source_config_path) { File.expand_path(File.join(Onetime::HOME, 'tests', 'unit', 'ruby', 'config.test.yaml')) } let(:loaded...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/initializers/boot_part2_spec.rb
tests/unit/ruby/rspec/onetime/initializers/boot_part2_spec.rb
# tests/unit/ruby/rspec/onetime/initializers/boot_part2_spec.rb require_relative '../../spec_helper' require 'fileutils' require 'yaml' require 'erb' RSpec.describe "Onetime global state after boot" do let(:source_config_path) { File.expand_path(File.join(Onetime::HOME, 'tests', 'unit', 'ruby', 'config.test.yaml'))...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/initializers/boot_part1_spec.rb
tests/unit/ruby/rspec/onetime/initializers/boot_part1_spec.rb
# tests/unit/ruby/rspec/onetime/initializers/boot_part1_spec.rb require_relative '../../spec_helper' require 'fileutils' # For managing temp config files require 'yaml' # For parsing YAML strings require 'erb' # For processing ERB in YAML strings RSpec.describe "Onetime::Config during Onetime.boot!" do l...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/mail/mail_module_spec.rb
tests/unit/ruby/rspec/onetime/mail/mail_module_spec.rb
# tests/unit/ruby/rspec/onetime/mail/mail_module_spec.rb require_relative '../../spec_helper' require 'onetime/mail' RSpec.describe Onetime::Mail do before do # Reset the mailer before each test described_class.reset_mailer # Mock the OT configuration allow(OT).to receive(:conf).and_return({ ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/mail/mailer/sendgrid_mailer_spec.rb
tests/unit/ruby/rspec/onetime/mail/mailer/sendgrid_mailer_spec.rb
# tests/unit/ruby/rspec/onetime/mail/mailer/sendgrid_mailer_spec.rb require_relative '../../../spec_helper' require 'onetime/mail/mailer/sendgrid_mailer' RSpec.describe Onetime::Mail::Mailer::SendGridMailer do let(:from_email) { 'sender@example.com' } let(:from_name) { 'Test Sender' } let(:to_address) { 'recipi...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/mail/mailer/smtp_mailer_spec.rb
tests/unit/ruby/rspec/onetime/mail/mailer/smtp_mailer_spec.rb
# tests/unit/ruby/rspec/onetime/mail/mailer/smtp_mailer_spec.rb require_relative '../../../spec_helper' require 'onetime/mail/mailer/smtp_mailer' RSpec.describe Onetime::Mail::Mailer::SMTPMailer do let(:from_email) { 'system@example.com' } let(:from_name) { 'System Sender' } let(:reply_to) { 'sender@example.com...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/mail/mailer/ses_mailer_spec.rb
tests/unit/ruby/rspec/onetime/mail/mailer/ses_mailer_spec.rb
# tests/unit/ruby/rspec/onetime/mail/mailer/ses_mailer_spec.rb require_relative '../../../spec_helper' require 'aws-sdk-sesv2' require 'onetime/mail/mailer/ses_mailer' RSpec.describe Onetime::Mail::Mailer::SESMailer do let(:from_email) { 'sender@example.com' } let(:from_name) { 'Test Sender' } let(:to_email) { ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/mail/views/welcome_spec.rb
tests/unit/ruby/rspec/onetime/mail/views/welcome_spec.rb
# tests/unit/ruby/rspec/onetime/mail/views/welcome_spec.rb require_relative '../../../spec_helper' RSpec.describe Onetime::Mail::Welcome do include_context "mail_test_context" it_behaves_like "mail delivery behavior" subject(:welcome_email) do with_emailer( described_class.new(mail_customer, 'en', ma...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/mail/views/secret_link_spec.rb
tests/unit/ruby/rspec/onetime/mail/views/secret_link_spec.rb
# tests/unit/ruby/rspec/onetime/mail/views/secret_link_spec.rb require_relative '../../../spec_helper' RSpec.describe Onetime::Mail::SecretLink do include_context "mail_test_context" it_behaves_like "mail delivery behavior" subject(:secret_link) do # Use helper that properly handles emailer injection w...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/helpers/homepage_mode_helpers_spec.rb
tests/unit/ruby/rspec/onetime/helpers/homepage_mode_helpers_spec.rb
# tests/unit/ruby/rspec/onetime/helpers/homepage_mode_helpers_spec.rb # frozen_string_literal: true require_relative '../../spec_helper' require 'ipaddr' # Test class that includes the module for testing class HomepageModeTestClass include Onetime::Helpers::HomepageModeHelpers attr_accessor :req def initialize...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
true
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/migration/base_migration_spec.rb
tests/unit/ruby/rspec/onetime/migration/base_migration_spec.rb
# tests/unit/ruby/rspec/onetime/migration/base_migration_spec.rb # # Tests for Onetime::BaseMigration framework # require_relative '../../spec_helper' require 'onetime/migration/base_migration' RSpec.describe Onetime::BaseMigration, :v023 do include_context "migration_test_context" # Test implementation that ove...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/migration/config_helpers_spec.rb
tests/unit/ruby/rspec/onetime/migration/config_helpers_spec.rb
# tests/unit/ruby/rspec/onetime/migration/config_helpers_spec.rb require_relative '../../spec_helper' # Load migration to access its methods migration_path = File.expand_path('../../../../../../../migrations/20250727-1523_02_reorganize_config_structure.rb', __FILE__) load migration_path RSpec.describe 'Config Migrat...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/config/load_spec.rb
tests/unit/ruby/rspec/onetime/config/load_spec.rb
# tests/unit/ruby/rspec/onetime/config/file_loading_spec.rb require_relative '../../spec_helper' require 'tempfile' require 'fileutils' RSpec.describe Onetime::Config do let(:temp_dir) { Dir.mktmpdir('onetime_config_test') } let(:test_config_path) { File.join(temp_dir, 'config.yaml') } let(:valid_yaml) do <...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/config/apply_config_spec.rb
tests/unit/ruby/rspec/onetime/config/apply_config_spec.rb
# tests/unit/ruby/rspec/onetime/config/apply_config_spec.rb require_relative '../../spec_helper' require 'onetime/models' RSpec.describe Onetime::Config do describe '#apply_config' do let(:original_config) do { site: { host: 'localhost', ssl: false, interface: { ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/config/after_load_spec.rb
tests/unit/ruby/rspec/onetime/config/after_load_spec.rb
# tests/unit/ruby/rspec/onetime/config/after_load_spec.rb require_relative '../../spec_helper' require 'tempfile' # The Sentry lib is only required when diagnostics are enabled. We don't include # it here b/c we stub the class so we can write expectant testcases. We'll want # to also test that the library is required...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/config/truemail_spec.rb
tests/unit/ruby/rspec/onetime/config/truemail_spec.rb
# tests/unit/ruby/rspec/onetime/config/truemail_spec.rb require_relative '../../spec_helper' RSpec.describe "Onetime TrueMail configuration" do describe "integration in Config.after_load" do let(:minimal_config) do { development: { enabled: false }, site: { authentication: { enab...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/config/i18n_spec.rb
tests/unit/ruby/rspec/onetime/config/i18n_spec.rb
# tests/unit/ruby/rspec/config/i18n_spec.rb # e.g. pnpm run rspec tests/unit/ruby/rspec/config/i18n_spec.rb require_relative '../../spec_helper' RSpec.describe "Internationalization config" do describe Onetime do describe '.locales' do context 'when config not loaded' do let(:original_state) do ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/config/deep_merge_spec.rb
tests/unit/ruby/rspec/onetime/config/deep_merge_spec.rb
# tests/unit/ruby/rspec/onetime/config/deep_merge_spec.rb require_relative '../../spec_helper' RSpec.describe Onetime::Config do # Since deep_merge is private, we need to use send to test it directly # Note: deep_merge now returns an IndifferentHash with string keys internally. # We use a helper to compare valu...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/config/apply_defaults_to_peers_spec.rb
tests/unit/ruby/rspec/onetime/config/apply_defaults_to_peers_spec.rb
# tests/unit/ruby/rspec/onetime/config/apply_defaults_to_peers.rb require_relative '../../spec_helper' RSpec.describe Onetime::Config do describe '#apply_defaults_to_peers' do let(:basic_config) do { defaults: { timeout: 5, enabled: true }, api: { timeout: 10 }, web: {}, ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/rspec/onetime/refinements/rack_refinements_spec.rb
tests/unit/ruby/rspec/onetime/refinements/rack_refinements_spec.rb
# tests/unit/ruby/rspec/onetime/refinements/rack_refinements_spec.rb require_relative '../../spec_helper' require 'onetime/refinements/rack_refinements' RSpec.describe Onetime::RackRefinements do module RefineTest using Onetime::RackRefinements def self.fetch_with_refinements(hash, key, ...) hash.fe...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/90_routes_smoketest_try.rb
tests/unit/ruby/try/90_routes_smoketest_try.rb
# tests/unit/ruby/try/90_routes_smoketest_try.rb # These tryouts test the existence of basic routes for web, API, and colonel interfaces. # We're not testing inputs and outputs, just checking if the routes are supported. # # The tryouts use Rack::MockRequest to simulate HTTP requests to the application # and verify th...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/16_config_passphrase_options_try.rb
tests/unit/ruby/try/16_config_passphrase_options_try.rb
#!/usr/bin/env ruby require_relative 'test_helpers' ## Boot the application to load configuration OT.boot! :test, false OT.conf.nil? #=> false ## Check if site config exists OT.conf.key?(:site) #=> true ## Load basic configuration and check secret_options exists OT.conf[:site][:secret_options].class #=> Hash ## Ch...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/20_metadata_ttl_try.rb
tests/unit/ruby/try/20_metadata_ttl_try.rb
# tests/unit/ruby/try/20_metadata_ttl_try.rb # These tryouts test the V1::Controllers::Index.metadata_hsh method functionality. # The metadata_hsh method is responsible for transforming metadata # into a structured hash with enhanced information. # # We're testing various aspects of the metadata_hsh method, including:...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/40_email_template_locale_try.rb
tests/unit/ruby/try/40_email_template_locale_try.rb
# tests/unit/ruby/try/40_email_template_locale_try.rb # These tryouts test the email template functionality in the Onetime application. # They cover various aspects of email template handling, including: # # 1. Creating email views for different purposes (Welcome, SecretLink) # 2. Rendering email templates # 3. Handli...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/test_logic.rb
tests/unit/ruby/try/test_logic.rb
# tests/unit/ruby/try/test_logic.rb require_relative './test_models' require 'onetime/logic' Logic = TestVersion::Logic # Initialize rate limit events based on configuration. This # mimics the behaviour of apps/api/v*/application.rb. RateLimit.register_events({destroy_account: 1})
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/23_app_settings_try.rb
tests/unit/ruby/try/23_app_settings_try.rb
# tests/unit/ruby/try/23_app_settings_try.rb # These tryouts test the functionality of the AppSettings module in the Core::Views::BaseView class. # The AppSettings module provides configuration options for UTF-8 and URI encoding # middleware checks. # # We're testing various aspects of the AppSettings module, includin...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/30_session_try.rb
tests/unit/ruby/try/30_session_try.rb
# tests/unit/ruby/try/30_session_try.rb # These tryouts test the session management functionality in the Onetime application. # They cover various aspects of session handling, including: # # 1. Session creation and initialization # 2. Session identifiers and attributes # 3. Form field management within sessions # 4. A...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/40_email_template_try.rb
tests/unit/ruby/try/40_email_template_try.rb
# tests/unit/ruby/try/40_email_template_try.rb # These tryouts test the email template functionality in the Onetime application, # specifically for secret link emails with and without share_domain. # They cover: # # 1. Creating email views for SecretLink with and without share_domain # 2. Rendering email templates wit...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/15_config_try.rb
tests/unit/ruby/try/15_config_try.rb
# tests/unit/ruby/try/15_config_try.rb # These tryouts test the configuration functionality of the Onetime application. # The Config module is responsible for loading and managing application settings. # # We're testing various aspects of the configuration, including: # 1. Loading and accessing config files # 2. Verif...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/31_session_extended_try.rb
tests/unit/ruby/try/31_session_extended_try.rb
# tests/unit/ruby/try/31_session_extended_try.rb require 'benchmark' require_relative './test_models' # Use the default config file for tests OT.boot! :test, false @ipaddress = '10.0.0.254' @useragent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_2_5) AppleWebKit/237.36 (KHTML, like Gecko) Chrome/10.0.95 Safari/237.3...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/10_utils_fortunes_try.rb
tests/unit/ruby/try/10_utils_fortunes_try.rb
# tests/unit/ruby/try/10_utils_fortunes_try.rb require_relative './test_helpers' OT.boot! :test, false @original_fortunes = Onetime::Utils.instance_variable_get(:@fortunes) ## random_fortune returns a string Onetime::Utils.random_fortune.class #=> String ## random_fortune returns non-empty string when successful O...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/22_value_encryption_try.rb
tests/unit/ruby/try/22_value_encryption_try.rb
# tests/unit/ruby/try/22_value_encryption_try.rb # These tryouts test the encryption and decryption functionality # of the V2::Secret class. # # We're testing various aspects of secret handling, including: # 1. Storing a value # 2. Encrypting a value # 3. Decrypting a value # 4. Behavior when decrypting without prior ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/test_models.rb
tests/unit/ruby/try/test_models.rb
# tests/unit/ruby/try/test_models.rb # # This file provides convenient access to model classes for testing purposes. # It creates top-level constants (e.g., Customer) to versioned namespaces # (e.g., V2::Customer), allowing tests to use cleaner, more readable code # without version-specific references. # # Future impro...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/17_passphrase_validation_try.rb
tests/unit/ruby/try/17_passphrase_validation_try.rb
#!/usr/bin/env ruby require_relative 'test_helpers' # Load configuration for testing OT.boot! :test, false ## Test passphrase validation when not required # Create a mock secret action for testing class TestSecretAction < V2::Logic::Secrets::BaseSecretAction def initialize(params = {}) @params = params @pa...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/75_stripe_event_try.rb
tests/unit/ruby/try/75_stripe_event_try.rb
# tests/unit/ruby/try/75_stripe_event_try.rb # frozen_string_literal: true # These tryouts test the StripeEvent model functionality in the Onetime application. # They cover various aspects of Stripe event management, including: # # 1. StripeEvent creation and initialization # 2. StripeEvent attributes (custid, eventi...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/91_authentication_routes_try.rb
tests/unit/ruby/try/91_authentication_routes_try.rb
# tests/unit/ruby/try/91_authentication_routes_try.rb # These tryouts test the authentication-related routes # and how they respond based on the authentication # settings in etc/config. (NOTE: In test the file is # etc/config.test.yaml). # # The tryouts for POST requests are disabled because # are returning 302 nil lo...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/68_receive_feedback_try.rb
tests/unit/ruby/try/68_receive_feedback_try.rb
# tests/unit/ruby/try/68_receive_feedback_try.rb # These tryouts test the feedback receiving functionality in the Onetime application. # They cover various aspects of handling user feedback, including: # # 1. Creating and processing feedback instances # 2. Validating feedback input # 3. Handling anonymous feedback att...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/23_passphrase_try.rb
tests/unit/ruby/try/23_passphrase_try.rb
# tests/unit/ruby/try/23_passphrase_try.rb # These tryouts test the functionality of passphrase handling in the Onetime application. # Specifically, they focus on: # # 1. Storing a plaintext passphrase # 2. Storing and verifying a one-way encrypted passphrase # # These tests aim to ensure that passphrases are correctl...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/16_config_secret_options_try.rb
tests/unit/ruby/try/16_config_secret_options_try.rb
# tests/unit/ruby/try/16_config_secret_options_try.rb # These tryouts test the secret_options configuration of the Onetime application. # We're testing various aspects of the secret_options configuration, including: # 1. Loading and accessing the secret_options configuration # 2. Verifying the structure of secret_opti...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/21_secret_try.rb
tests/unit/ruby/try/21_secret_try.rb
# tests/unit/ruby/try/21_secret_try.rb # These tryouts test the V2::Secret class functionality. # The Secret class is responsible for managing secrets in the # Onetime application. # # We're testing various aspects of the Secret class, including: # 1. Creation of Secret objects # 2. Consistency of Redis keys # 3. Spaw...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/20_metadata_try.rb
tests/unit/ruby/try/20_metadata_try.rb
# tests/unit/ruby/try/20_metadata_try.rb # These tryouts test the V2::Metadata class functionality. # The Metadata class is responsible for managing metadata associated # with secrets in the Onetime application. # # We're testing various aspects of the Metadata class, including: # 1. Creation and initialization of Met...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/16_config_emailer_try.rb
tests/unit/ruby/try/16_config_emailer_try.rb
# tests/unit/ruby/try/16_config_emailer_try.rb require_relative './test_helpers' # Use the default config file for tests OT.boot! :test, false ## Default emailer mode is :smtp OT.conf[:emailer][:mode] #=> 'smtp' ## Default emailer from address is "CHANGEME@example.com" OT.conf[:emailer][:from] #=> "tests@example.co...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/12_indifferent_hash_try.rb
tests/unit/ruby/try/12_indifferent_hash_try.rb
# tests/unit/ruby/try/12_indifferent_hash_try.rb # frozen_string_literal: true require_relative '../../../../lib/onetime/indifferent_hash' require 'yaml' # ----------------------------------------------------------------------------- # Setup # --------------------------------------------------------------------------...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/50_subdomain_try.rb
tests/unit/ruby/try/50_subdomain_try.rb
# tests/unit/ruby/try/50_subdomain_try.rb # These tryouts test the subdomain functionality in the Onetime application. # They cover various aspects of subdomain management, including: # # 1. Creating and normalizing subdomains # 2. Checking subdomain existence and ownership # 3. Mapping subdomains to customer IDs # 4....
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/05_logging.rb
tests/unit/ruby/try/05_logging.rb
# tests/unit/ruby/try/05_logging.rb # # Capture STDOUT and STDERR for testing # # Tryouts (the library) does its own capturing which conflicts with # capture_io so these tests are skipped while we sort out how to make # them work together. This is low risk since the tests are just for # demonstration and debugging pur...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/test_helpers.rb
tests/unit/ruby/try/test_helpers.rb
# tests/unit/ruby/try/test_helpers.rb # A custom hash class that allows indifferent access to keys. # Keys can be accessed using strings, symbols, or methods. # Helpul # # # Example: # # http_response = IndifferentHash.new( # code: 403, # error: 'Forbidden', # body: 'You are not allowed to access...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/35_ratelimit_try.rb
tests/unit/ruby/try/35_ratelimit_try.rb
# tests/unit/ruby/try/35_ratelimit_try.rb # These tryouts test the rate limiting functionality in the Onetime application. # They cover various aspects of rate limiting, including: # # 1. Defining and registering rate limit events # 2. Creating and managing rate limiters # 3. Checking if limits are exceeded # 4. Handl...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/19_safe_dump_try.rb
tests/unit/ruby/try/19_safe_dump_try.rb
# tests/unit/ruby/try/19_safe_dump_try.rb # These tryouts test the safe dumping functionality. require_relative './test_models' # Use the default config file for tests OT.boot! :test, true @email = 'tryouts-19@onetimesecret.com' ## By default there are no safe dump fields Familia::Features::SafeDump.safe_dump_fiel...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/11_cached_method_try.rb
tests/unit/ruby/try/11_cached_method_try.rb
# tests/unit/ruby/try/11_cached_method_try.rb # These tryouts test the functionality of the cached_method in the Core::ViewHelpers module. # The cached_method provides a caching mechanism for method results using Redis. # # We're testing various aspects of the cached_method, including: # 1. Caching of method results #...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/99_truemail_config_try.rb
tests/unit/ruby/try/99_truemail_config_try.rb
# frozen_string_literal: true # These tryouts test the TrueMail configuration integration in the Onetime application. # They cover: # # 1. Key mapping between OneTime's naming conventions and TrueMail's API # 2. Validation of required TrueMail configuration # 3. Application of default and custom settings # # These tes...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/17_mail_validation.rb
tests/unit/ruby/try/17_mail_validation.rb
# tests/unit/ruby/try/17_mail_validation.rb # These tryouts test the email validation functionality using the Truemail gem. # Email validation is crucial for ensuring that user-provided email addresses # are valid and potentially deliverable. # # We're testing various aspects of email validation, including: # 1. Confi...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/15_config_indifferent_access_try.rb
tests/unit/ruby/try/15_config_indifferent_access_try.rb
# tests/unit/ruby/try/15_config_indifferent_access_try.rb # frozen_string_literal: true # # Integration test for IndifferentHash config access # # Validates that Config.deep_merge works with IndifferentHash and preserves # symbol/string key access after merging. # # Usage: # bundle exec try tests/unit/ruby/try/15_co...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/25_customer_try.rb
tests/unit/ruby/try/25_customer_try.rb
# tests/unit/ruby/try/25_customer_try.rb # These tryouts test the customer model functionality in the Onetime application. # They cover various aspects of customer management, including: # # 1. Customer creation and initialization # 2. Customer attributes (planid, custid, role, etc.) # 3. Customer states (pending, ver...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/26_email_receipt_try.rb
tests/unit/ruby/try/26_email_receipt_try.rb
# tests/unit/ruby/try/26_email_receipt_try.rb # These tryouts cover various aspects of the EmailReceipt model, including: # # 1. Checking the correct prefix, suffix, and identifier # 2. Verifying the rediskey format # 3. Creating a new EmailReceipt # 4. Checking the fields of a new EmailReceipt # 5. Verifying existenc...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/05_logging_sync_try.rb
tests/unit/ruby/try/05_logging_sync_try.rb
# tests/unit/ruby/try/05_logging_sync_try.rb # # Capture STDOUT and STDERR for testing # # Tryouts (the library) does its own capturing which conflicts with # capture_io so these tests are skipped while we sort out how to make # them work together. This is low risk since the tests are just for # demonstration and debu...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/72_approximated.rb
tests/unit/ruby/try/72_approximated.rb
# tests/unit/ruby/try/72_approximated.rb # These tryouts test the functionality of Approximated and the # Approximate API. Note that this tryouts file has no _try # suffix. This is intentional so that it is not run by # default. Otherwise we'd be hammering the Approximated API # with requests that are not actually goi...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/10_utils_try.rb
tests/unit/ruby/try/10_utils_try.rb
# tests/unit/ruby/try/10_utils_try.rb # These tryouts test the functionality of the Onetime::Utils module. # The Utils module provides various utility functions used throughout # the Onetime application. # # We're testing various aspects of the Utils module, including: # 1. Generation of random strands # 2. Email addr...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/42_web_template_vuepoint_try.rb
tests/unit/ruby/try/42_web_template_vuepoint_try.rb
# tests/unit/ruby/try/42_web_template_vuepoint_try.rb # These tryouts test the VuePoint view functionality in the Onetime application, # with a focus on the initialization process and its arguments. # They cover: # # 1. Creating and initializing a VuePoint view with various arguments # 2. Testing the visibility of dif...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/80_incoming/01_incoming_feature_integration_try.rb
tests/unit/ruby/try/80_incoming/01_incoming_feature_integration_try.rb
# tests/unit/ruby/try/80_incoming/01_incoming_feature_integration_try.rb require_relative '../test_logic' # Setup ENV['INCOMING_ENABLED'] = 'true' ENV['INCOMING_MEMO_MAX_LENGTH'] = '80' ENV['INCOMING_DEFAULT_TTL'] = '86400' ENV['INCOMING_DEFAULT_PASSPHRASE'] = 'integration-test-pass' ENV['INCOMING_RECIPIENT_1'] = 'su...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/50_middleware/20_domain_strategy_basics_try.rb
tests/unit/ruby/try/50_middleware/20_domain_strategy_basics_try.rb
# tests/unit/ruby/try/50_middleware/20_domain_strategy_basics_try.rb require_relative '../test_helpers' require 'middleware/detect_host' require 'onetime/middleware/domain_strategy' # Setup OT.boot! :test, false @canonical_domain = 'onetimesecret.com' @parser = Onetime::DomainStrategy::Parser @chooser = Onetime::Do...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/50_middleware/22_domain_strategy_chooserator_try.rb
tests/unit/ruby/try/50_middleware/22_domain_strategy_chooserator_try.rb
# tests/unit/ruby/try/50_middleware/22_domain_strategy_chooserator_try.rb require_relative '../test_helpers' require 'middleware/detect_host' require 'onetime/middleware/domain_strategy' @base_domain = 'example.com' @canonical = PublicSuffix.parse(@base_domain) ## equal_to? matches exact domains Onetime::DomainStra...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/50_middleware/21_domain_strategy_multiple_canonical_try.rb
tests/unit/ruby/try/50_middleware/21_domain_strategy_multiple_canonical_try.rb
# tests/unit/ruby/try/50_middleware/21_domain_strategy_multiple_canonical_try.rb require_relative '../test_helpers' require 'middleware/detect_host' require 'onetime/middleware/domain_strategy' # Setup OT.boot! :test, false @canonical_domain = 'eu.example.com' @parser = Onetime::DomainStrategy::Parser @chooser = On...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/50_middleware/20_domain_strategy_try.rb
tests/unit/ruby/try/50_middleware/20_domain_strategy_try.rb
# tests/unit/ruby/try/50_middleware/20_domain_strategy_try.rb # These tryouts test the DomainStrategy middleware class that handles # domain strategy determination and validation using a state machine require_relative '../test_models' require 'middleware/detect_host' require 'onetime/middleware/domain_strategy' OT....
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/00_middleware/11_detect_host_try.rb
tests/unit/ruby/try/00_middleware/11_detect_host_try.rb
# These tryouts test the DetectHost middleware functionality. # The DetectHost middleware is responsible for determining the correct hostname # from various HTTP headers, while filtering out invalid hosts like localhost # and IP addresses. # # We're testing: # 1. Header precedence (X-Forwarded-Host, X-Original-Host, Fo...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/00_middleware/22_handle_invalid_utf8_try.rb
tests/unit/ruby/try/00_middleware/22_handle_invalid_utf8_try.rb
# tests/unit/ruby/try/00_middleware/22_handle_invalid_utf8_try.rb # These tryouts test the Rack::HandleInvalidUTF8 middleware, # focusing on scenarios involving invalid UTF-8 characters in # different types of HTTP requests. # # We're testing various scenarios, including: # 1. Requests with invalid UTF-8 in headers # ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/00_middleware/12_detect_host_instances_try.rb
tests/unit/ruby/try/00_middleware/12_detect_host_instances_try.rb
# tests/unit/ruby/try/00_middleware/12_detect_host_instances_try.rb # These tryouts verify whether Rack instantiates a new middleware instance per # request or reuses the same instance across requests using real Rack requests. require_relative '../test_helpers' require 'stringio' require 'middleware/detect_host' # ...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false
onetimesecret/onetimesecret
https://github.com/onetimesecret/onetimesecret/blob/c58548274ad44e644295258a31d5d2f81aaffc15/tests/unit/ruby/try/00_middleware/21_handle_invalid_percent_encoding_try.rb
tests/unit/ruby/try/00_middleware/21_handle_invalid_percent_encoding_try.rb
# tests/unit/ruby/try/00_middleware/21_handle_invalid_percent_encoding_try.rb # These tryouts replicate and test edge cases related to # Rack::Request parameter parsing, specifically focusing on scenarios involving # percent-encoding in different types of HTTP requests. # # We're replicating issues that can occur when...
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/27_domains_try.rb
tests/unit/ruby/try/20_models/27_domains_try.rb
# tests/unit/ruby/try/20_models/27_domains_try.rb # These tryouts test domain-related functionality using the PublicSuffix gem require 'public_suffix' require_relative '../test_models' # Load the app OT.boot! :test, false @email = "Tryouts+27+#{Time.now.to_i}@onetimesecret.com" @email2 = "Tryouts+27b+#{Time.now.to...
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/27_domains_publicsuffix_try.rb
tests/unit/ruby/try/20_models/27_domains_publicsuffix_try.rb
# tests/unit/ruby/try/20_models/27_domains_publicsuffix_try.rb # These tryouts test domain-related functionality using the PublicSuffix gem require 'public_suffix' require_relative '../test_helpers' # Load the app OT.boot! :test, false # Setup @public_suffix_list = PublicSuffix::List.default @domains = [ 'exampl...
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/27_domains_expiration_try.rb
tests/unit/ruby/try/20_models/27_domains_expiration_try.rb
# tests/unit/ruby/try/20_models/27_domains_expiration_try.rb require 'securerandom' require_relative '../test_models' #Familia.debug = true # Load the app OT.boot! :test, false @customer = V1::Customer.create "Tryouts+27+#{SecureRandom.uuid}@onetimesecret.com" @domain = 'example.com' ## Base update_expiration acc...
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/10_system_settings_class_methods_try.rb
tests/unit/ruby/try/20_models/10_system_settings_class_methods_try.rb
# tests/unit/ruby/try/20_models/10_system_settings_class_methods_try.rb # redis-server --port 2121 --save "" --appendonly no # clear && ONETIME_DEBUG=1 REDIS_URL='redis://127.0.0.1:2121/0' bundle exec try -vf tests/unit/ruby/try/20_models/10_system_settings_class_methods_try.rb # REDIS_URL='redis://127.0.0.1:2121/0' r...
ruby
MIT
c58548274ad44e644295258a31d5d2f81aaffc15
2026-01-04T15:53:41.320614Z
false