Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #37878 - expose hidden_value attribute when creating parameters #10341

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading