1
0
Fork 0

added basic auth interface changes and supporting code

Dieser Commit ist enthalten in:
Robert Barrow 2019-06-02 23:59:35 +01:00
Ursprung f331f80cbb
Commit cc98a14d15
4 geänderte Dateien mit 91 neuen und 68 gelöschten Zeilen

Datei anzeigen

@ -59,7 +59,7 @@ export default Ember.Controller.extend({
}); });
} }
} else { } else {
// basic auth // basic auth - no need to authorize separately
} }
window.location.href = authUrl + query; window.location.href = authUrl + query;
@ -104,6 +104,7 @@ export default Ember.Controller.extend({
} }
const endpoints = api.endpoints; const endpoints = api.endpoints;
if (endpoints.length) { if (endpoints.length) {
data['endpoints'] = JSON.stringify(endpoints); data['endpoints'] = JSON.stringify(endpoints);
} }

Datei anzeigen

@ -24,6 +24,8 @@ CustomWizardApi.reopenClass({
tokenUrl: authorization.token_url, tokenUrl: authorization.token_url,
clientId: authorization.client_id, clientId: authorization.client_id,
clientSecret: authorization.client_secret, clientSecret: authorization.client_secret,
username: authorization.username,
password: authorization.password,
authParams: Ember.A(authorization.auth_params), authParams: Ember.A(authorization.auth_params),
authorized: authorization.authorized, authorized: authorization.authorized,
accessToken: authorization.access_token, accessToken: authorization.access_token,

Datei anzeigen

@ -45,6 +45,7 @@
{{i18n 'admin.wizard.api.auth.settings'}} {{i18n 'admin.wizard.api.auth.settings'}}
</div> </div>
{{#if isOauth}}
{{#if api.name}} {{#if api.name}}
<div class="control-group redirect-uri"> <div class="control-group redirect-uri">
<div class="control-label"> <div class="control-label">
@ -55,6 +56,7 @@
</div> </div>
</div> </div>
{{/if}} {{/if}}
{{/if}}
<div class="control-group auth-type"> <div class="control-group auth-type">
<label>{{i18n 'admin.wizard.api.auth.type'}}</label> <label>{{i18n 'admin.wizard.api.auth.type'}}</label>
@ -63,6 +65,7 @@
</div> </div>
</div> </div>
{{#if isOauth}}
<div class="control-group"> <div class="control-group">
<label>{{i18n 'admin.wizard.api.auth.url'}}</label> <label>{{i18n 'admin.wizard.api.auth.url'}}</label>
<div class="controls"> <div class="controls">
@ -77,7 +80,6 @@
</div> </div>
</div> </div>
{{#if isOauth}}
<div class="control-group"> <div class="control-group">
<label>{{i18n 'admin.wizard.api.auth.client_id'}}</label> <label>{{i18n 'admin.wizard.api.auth.client_id'}}</label>
<div class="controls"> <div class="controls">
@ -105,9 +107,24 @@
{{d-button label='admin.wizard.api.auth.params.new' icon='plus' action='addParam'}} {{d-button label='admin.wizard.api.auth.params.new' icon='plus' action='addParam'}}
</div> </div>
</div> </div>
{{else}}
<div class="control-group">
<label>{{i18n 'admin.wizard.api.auth.username'}}</label>
<div class="controls">
{{input value=api.username}}
</div>
</div>
<div class="control-group">
<label>{{i18n 'admin.wizard.api.auth.password'}}</label>
<div class="controls">
{{input value=api.password}}
</div>
</div>
{{/if}} {{/if}}
</div> </div>
{{#if isOauth}}
<div class="status"> <div class="status">
<div class="authorization"> <div class="authorization">
{{#if api.authorized}} {{#if api.authorized}}
@ -158,6 +175,7 @@
</div> </div>
</div> </div>
</div> </div>
{{/if}}
</div> </div>
<div class="wizard-header"> <div class="wizard-header">

Datei anzeigen

@ -149,6 +149,8 @@ en:
token_url: "Token url" token_url: "Token url"
client_id: 'Client id' client_id: 'Client id'
client_secret: 'Client secret' client_secret: 'Client secret'
username: 'username'
password: 'password'
params: params:
label: 'Params' label: 'Params'
new: 'New param' new: 'New param'