Skip to content

Commit

Permalink
Add scope validation
Browse files Browse the repository at this point in the history
  • Loading branch information
alombarte committed Feb 24, 2021
1 parent ee26437 commit 6e3a177
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/app/forms/service_discovery.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
<div class="col-md-6">
<middleware data="service" template="etcd.html" namespace="'github_com/devopsfaith/krakend-etcd'"></middleware>
</div>


34 changes: 28 additions & 6 deletions src/app/middlewares/jose_validator.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,8 @@ <h3 class="box-title">
<div class="box-body">
<p ng-if="!isMiddlewareEnabled()">Enable to validate JWT tokens</p>
<div ng-if="isMiddlewareEnabled()">
<p>Only the <strong>algorithm</strong> and the location of your <strong>jwk</strong> are mandatory fields.</p>
<div class="form-group">
<div class="col-md-6">
<label>JWK URI</label>
<input type="text" ng-model="data.extra_config[config_namespace]['jwk-url']" class="form-control" />
<span class="help-block">The URL to your JWK endpoint with the set of public keys used to verify the
authenticity of JWT</span>
</div>
<div class="col-md-6">
<label class="control-label">Algorithm</label>
<select class="form-control" ng-model="data.extra_config[config_namespace].alg" id="data.extra_config[config_namespace].alg"
Expand All @@ -27,6 +22,33 @@ <h3 class="box-title">
</select>
<span class="help-block">Digital signatures and MACs algorithm</span>
</div>
<div class="col-md-6">
<label>JWK URI</label>
<input type="text" ng-model="data.extra_config[config_namespace]['jwk-url']" class="form-control" />
<span class="help-block">The URL to your JWK endpoint with the set of public keys used to verify the
authenticity of JWT</span>
</div>

</div>
<div class="form-group">
<div class="col-md-4">
<label>Scopes to validate</label>
<input type="text" ng-model="data.extra_config[config_namespace]['scopes']" class="form-control" />
<span class="help-block">List of all (or any) scopes that the user should have to access this endpoint. Space separated.</span>
</div>
<div class="col-md-2">
<label>Matcher</label>
<select class="form-control" ng-model="data.extra_config[config_namespace].scopes_matcher">
<option value="any">Any</option>
<option value="all">All</option>
</select>
</div>
<div class="col-md-6">
<label>Scopes Key</label>
<input type="text" ng-model="data.extra_config[config_namespace].scopes_key" class="form-control" />
<span class="help-block">The key name where the scopes can be found. The key can be a nested object using the . dot notation, e.g.: data.data2.scopes</span>
</div>

</div>
<div class="form-group">
<div class="col-md-12">
Expand Down

0 comments on commit 6e3a177

Please sign in to comment.