diff options
Diffstat (limited to 'lib/gitlab/ci/secure_files/x509_name.rb')
-rw-r--r-- | lib/gitlab/ci/secure_files/x509_name.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/gitlab/ci/secure_files/x509_name.rb b/lib/gitlab/ci/secure_files/x509_name.rb new file mode 100644 index 00000000000..659959b8ae5 --- /dev/null +++ b/lib/gitlab/ci/secure_files/x509_name.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +module Gitlab + module Ci + module SecureFiles + class X509Name + def self.parse(x509_name) + x509_name.to_utf8.split(',').to_h { |a| a.split('=') } + rescue StandardError + {} + end + end + end + end +end |