Class: SupplyChain::Slsa::ProvenanceStatement::ExternalParameters

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/supply_chain/slsa/provenance_statement.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#entry_pointObject

Returns the value of attribute entry_point.



108
109
110
# File 'app/models/supply_chain/slsa/provenance_statement.rb', line 108

def entry_point
  @entry_point
end

#sourceObject

Returns the value of attribute source.



108
109
110
# File 'app/models/supply_chain/slsa/provenance_statement.rb', line 108

def source
  @source
end

#variablesObject

Returns the value of attribute variables.



108
109
110
# File 'app/models/supply_chain/slsa/provenance_statement.rb', line 108

def variables
  @variables
end

Class Method Details

.from_build(build) ⇒ Object



110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# File 'app/models/supply_chain/slsa/provenance_statement.rb', line 110

def self.from_build(build)
  source = Gitlab::Routing.url_helpers.project_url(build.project)
  entry_point = build.name

  variables = {}
  build.variables.each do |variable|
    variables[variable.key] = if variable.masked?
                                '[MASKED]'
                              else
                                variable.value
                              end
  end

  ExternalParameters.new(source: source, entry_point: entry_point, variables: variables)
end