added basic auth interface changes and supporting code
Dieser Commit ist enthalten in:
Ursprung
f331f80cbb
Commit
cc98a14d15
4 geänderte Dateien mit 91 neuen und 68 gelöschten Zeilen
|
@ -59,7 +59,7 @@ export default Ember.Controller.extend({
|
|||
});
|
||||
}
|
||||
} else {
|
||||
// basic auth
|
||||
// basic auth - no need to authorize separately
|
||||
}
|
||||
|
||||
window.location.href = authUrl + query;
|
||||
|
@ -104,6 +104,7 @@ export default Ember.Controller.extend({
|
|||
}
|
||||
|
||||
const endpoints = api.endpoints;
|
||||
|
||||
if (endpoints.length) {
|
||||
data['endpoints'] = JSON.stringify(endpoints);
|
||||
}
|
||||
|
|
|
@ -24,6 +24,8 @@ CustomWizardApi.reopenClass({
|
|||
tokenUrl: authorization.token_url,
|
||||
clientId: authorization.client_id,
|
||||
clientSecret: authorization.client_secret,
|
||||
username: authorization.username,
|
||||
password: authorization.password,
|
||||
authParams: Ember.A(authorization.auth_params),
|
||||
authorized: authorization.authorized,
|
||||
accessToken: authorization.access_token,
|
||||
|
|
|
@ -45,15 +45,17 @@
|
|||
{{i18n 'admin.wizard.api.auth.settings'}}
|
||||
</div>
|
||||
|
||||
{{#if api.name}}
|
||||
<div class="control-group redirect-uri">
|
||||
<div class="control-label">
|
||||
<label>{{i18n 'admin.wizard.api.auth.redirect_uri'}}</label>
|
||||
<div class="controls">
|
||||
{{api.redirectUri}}
|
||||
{{#if isOauth}}
|
||||
{{#if api.name}}
|
||||
<div class="control-group redirect-uri">
|
||||
<div class="control-label">
|
||||
<label>{{i18n 'admin.wizard.api.auth.redirect_uri'}}</label>
|
||||
<div class="controls">
|
||||
{{api.redirectUri}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
||||
<div class="control-group auth-type">
|
||||
|
@ -63,21 +65,21 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.auth.url'}}</label>
|
||||
<div class="controls">
|
||||
{{input value=api.authUrl}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.auth.token_url'}}</label>
|
||||
<div class="controls">
|
||||
{{input value=api.tokenUrl}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{#if isOauth}}
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.auth.url'}}</label>
|
||||
<div class="controls">
|
||||
{{input value=api.authUrl}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.auth.token_url'}}</label>
|
||||
<div class="controls">
|
||||
{{input value=api.tokenUrl}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.auth.client_id'}}</label>
|
||||
<div class="controls">
|
||||
|
@ -105,59 +107,75 @@
|
|||
{{d-button label='admin.wizard.api.auth.params.new' icon='plus' action='addParam'}}
|
||||
</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}}
|
||||
</div>
|
||||
|
||||
<div class="status">
|
||||
<div class="authorization">
|
||||
{{#if api.authorized}}
|
||||
<span class="authorization-indicator authorized"></span>
|
||||
<span>{{i18n "admin.wizard.api.status.authorized"}}</span>
|
||||
{{else}}
|
||||
<span class="authorization-indicator not-authorized"></span>
|
||||
<span>{{i18n "admin.wizard.api.status.not_authorized"}}</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{#if isOauth}}
|
||||
<div class="status">
|
||||
<div class="authorization">
|
||||
{{#if api.authorized}}
|
||||
<span class="authorization-indicator authorized"></span>
|
||||
<span>{{i18n "admin.wizard.api.status.authorized"}}</span>
|
||||
{{else}}
|
||||
<span class="authorization-indicator not-authorized"></span>
|
||||
<span>{{i18n "admin.wizard.api.status.not_authorized"}}</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="wizard-header medium">
|
||||
{{i18n 'admin.wizard.api.status.label'}}
|
||||
</div>
|
||||
<div class="wizard-header medium">
|
||||
{{i18n 'admin.wizard.api.status.label'}}
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.status.code'}}</label>
|
||||
<div class="controls">
|
||||
{{api.code}}
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.status.code'}}</label>
|
||||
<div class="controls">
|
||||
{{api.code}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.status.access_token'}}</label>
|
||||
<div class="controls">
|
||||
{{api.accessToken}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.status.refresh_token'}}</label>
|
||||
<div class="controls">
|
||||
{{api.refreshToken}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.status.expires_at'}}</label>
|
||||
<div class="controls">
|
||||
{{api.tokenExpiresAt}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.status.refresh_at'}}</label>
|
||||
<div class="controls">
|
||||
{{api.tokenRefreshAt}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.status.access_token'}}</label>
|
||||
<div class="controls">
|
||||
{{api.accessToken}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.status.refresh_token'}}</label>
|
||||
<div class="controls">
|
||||
{{api.refreshToken}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.status.expires_at'}}</label>
|
||||
<div class="controls">
|
||||
{{api.tokenExpiresAt}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label>{{i18n 'admin.wizard.api.status.refresh_at'}}</label>
|
||||
<div class="controls">
|
||||
{{api.tokenRefreshAt}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<div class="wizard-header">
|
||||
|
|
|
@ -149,6 +149,8 @@ en:
|
|||
token_url: "Token url"
|
||||
client_id: 'Client id'
|
||||
client_secret: 'Client secret'
|
||||
username: 'username'
|
||||
password: 'password'
|
||||
params:
|
||||
label: 'Params'
|
||||
new: 'New param'
|
||||
|
|
Laden …
In neuem Issue referenzieren