Skip to content

Commit

Permalink
Fixes #37878 - expose hidden_value attribute when creating parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni authored and adamruzicka committed Oct 17, 2024
1 parent 861a788 commit 5615568
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/controllers/api/v2/parameters_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def show
param :name, String, :required => true
param :value, String, :required => true
param :parameter_type, Parameter::KEY_TYPES, :desc => N_("Type of value"), :required => true
param :hidden_value, :bool, :desc => N_("Should the value be hidden")
end
end

Expand Down
7 changes: 7 additions & 0 deletions test/controllers/api/v2/parameters_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,5 +419,12 @@ def assert_filtering_works(resource, id)
show_response = ActiveSupport::JSON.decode(@response.body)
assert_equal parameter.hidden_value, show_response['value']
end

test "should create hidden host parameter" do
assert_difference('@host.parameters.count') do
post :create, params: { :host_id => @host.to_param, :parameter => { :name => 'secret', :value => '123', :hidden_value => true } }
end
assert_response :created
end
end
end

0 comments on commit 5615568

Please sign in to comment.