Sha256: 295581801de69b70e6049f94528d2e1707b2b3b6865b6d848726931866b7dc1b
Contents?: true
Size: 914 Bytes
Versions: 1
Compression:
Stored size: 914 Bytes
Contents
module KnapsackPro module Crypto class BranchEncryptor NON_ENCRYPTABLE_BRANCHES = [ 'master', 'main', 'develop', 'development', 'dev', 'staging', # GitHub Actions has branch names starting with refs/heads/ 'refs/heads/master', 'refs/heads/main', 'refs/heads/develop', 'refs/heads/development', 'refs/heads/dev', 'refs/heads/staging', ] def self.call(branch) if KnapsackPro::Config::Env.branch_encrypted? new(branch).call else branch end end def initialize(branch) @branch = branch end def call if NON_ENCRYPTABLE_BRANCHES.include?(branch) branch else Digestor.salt_hexdigest(branch)[0..6] end end private attr_reader :branch end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
knapsack_pro-2.4.0 | lib/knapsack_pro/crypto/branch_encryptor.rb |