Skip to content

Commit

Permalink
feat: allow client name to be configured
Browse files Browse the repository at this point in the history
  • Loading branch information
Derik Evangelista committed Jun 22, 2020
1 parent fc4a0a1 commit 03ba028
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions jobs/broker/spec
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ properties:
resource_ids: <comma separated list of resource ids>
authorized_grant_types: <comma separated list of grant types>
authorities: <comma separated list of authorities>
name: <name>

service_instances_api.url:
description: "service instances API provider URL"
Expand Down
2 changes: 1 addition & 1 deletion jobs/broker/templates/broker.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ def normalise_cf_authentication(cf)
if cf['uaa']['client_definition'].nil?
cf['uaa'].delete('client_definition')
else
valid_props = %w{scopes authorities authorized_grant_types resource_ids}
valid_props = %w{scopes authorities authorized_grant_types resource_ids name}
cf['uaa']['client_definition'].keys.each do |k|
raise "Invalid client_definition config - valid properties are: #{valid_props.join(", ")}" unless valid_props.include? k
end
Expand Down
3 changes: 2 additions & 1 deletion spec/broker_config_template_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,7 @@
'resource_ids' => 'some-resource-id',
'authorized_grant_types' => 'some-authorization',
'authorities' => 'some-authority,another-authority',
'name' => 'some-name'
}
}

Expand All @@ -825,7 +826,7 @@
it 'raises an error' do
expect do
rendered_template
end.to raise_error(RuntimeError, 'Invalid client_definition config - valid properties are: scopes, authorities, authorized_grant_types, resource_ids')
end.to raise_error(RuntimeError, 'Invalid client_definition config - valid properties are: scopes, authorities, authorized_grant_types, resource_ids, name')
end
end

Expand Down

0 comments on commit 03ba028

Please sign in to comment.