[auth] Added api key and basic authorization

This commit is contained in:
Anna Bodnia
2016-03-04 20:55:57 +02:00
parent 4fdc174ea0
commit a268d007a2
24 changed files with 547 additions and 294 deletions

View File

@@ -0,0 +1,12 @@
<div class='key_input_container'>
<div class='auth__description'>{{description}}</div>
<div>
<span class='auth_label'><label for='input_apiKey_entry'><span>Api key</span> in {{in}}</label></span>
<span class='auth_in'><label for='input_apiKey_entry'>{{name}} =</label></span>
{{#if isLogout}}
<span class="auth_label">{{value}}</span>
{{else}}
<input placeholder='api_key' class='auth_input input_apiKey_entry' name='apiKey' type='text'/>
{{/if}}
</div>
</div>

View File

@@ -1,19 +0,0 @@
<div class='auth_container'>
<div class='key_input_container'>
<div class='auth__description'>{{description}}</div>
<div>
<span class='auth_label'><label for='input_apiKey_entry'><span>Api key</span> in {{in}}</label></span>
<span class='auth_in'><label for='input_apiKey_entry'>{{name}} =</label></span>
{{#if isLogout}}
<span class="auth_label">{{value}}</span>
{{else}}
<input placeholder='api_key' class='auth_input input_apiKey_entry' name='apiKey' type='text'/>
{{/if}}
</div>
{{#if isLogout}}
<input type="button" class="auth_logout__button" value="logout"></div>
{{else}}
<div class='auth_submit'><a class='auth_submit_button' href='#' data-sw-translate>apply</a></div>
{{/if}}
</div>
</div>

View File

@@ -0,0 +1,10 @@
<div class="auth_container">
<div class="auth_inner"></div>
{{#if isLogout}}
<input type="button" class="auth_logout__button" value="logout">
{{else}}
<div class="auth_submit"><a class="auth_submit_button" href="#" data-sw-translate>apply</a></div>
{{/if}}
</div>

View File

@@ -0,0 +1,12 @@
<div class='basic_auth_container'>
<h3 class="basic_auth__title">Basic authentication{{#if isLogout}} - authorized{{/if}}</h3>
{{#unless isLogout}}
<form class="key_input_container">
<div class="auth__description">{{description}}</div>
<div class="auth_label"><label data-sw-translate>username</label></div>
<input required placeholder="username" class="basic_auth__username auth_input" name="username" type="text"/>
<div class="auth_label"><label data-sw-translate>password</label></div>
<input required placeholder="password" class="basic_auth__password auth_input" name="password" type="password"/>
</form>
{{/unless}}
</div>

View File

@@ -1,17 +0,0 @@
<div class='auth_container basic_auth_container'>
<h3 class="basic_auth__title">Basic authentication</h3>
{{#if isLogout}}
<input type="button" class="auth_logout__button" value="logout"></div>
{{else}}
<form class="key_input_container">
<div class="auth__description">{{description}}</div>
<div class="auth_label"><label data-sw-translate>username</label></div>
<input required placeholder="username" class="basic_auth__username auth_input" name="username" type="text"/>
<div class="auth_label"><label data-sw-translate>password</label></div>
<input required placeholder="password" class="basic_auth__password auth_input" name="password" type="password"/>
<div class='auth_submit'><input type="submit" class="auth_submit__button" value="apply"></div>
</form>
{{/if}}
</div>

View File

@@ -23,6 +23,9 @@
<h4><span data-sw-translate>Implementation Notes</span></h4>
<div class="markdown">{{{description}}}</div>
{{/if}}
{{#if security}}
<div class='authorize-wrapper'></div>
{{/if}}
{{#oauth}}
<div class="auth">
<span class="api-ic ic-error">{{/oauth}}