-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: arekkas <[email protected]>
- Loading branch information
Showing
105 changed files
with
7,659 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "ory-oathkeeper-sdk", | ||
"version": "0.0.0", | ||
"description": "The official JavaScript / NodeJS SDK for ORY Oathkeeper.", | ||
"license": "Apache-2.0", | ||
"main": "sdk/js/swagger/src/index.js", | ||
"scripts": { | ||
"prettier": "prettier --single-quote --parser flow --no-semi --write \"sdk/js/**/*.js\"", | ||
"postinstall": "opencollective postinstall" | ||
}, | ||
"browser": { | ||
"fs": false | ||
}, | ||
"dependencies": { | ||
"opencollective": "^1.0.3", | ||
"superagent": "3.5.2" | ||
}, | ||
"devDependencies": { | ||
"prettier": "^1.12.1" | ||
}, | ||
"collective": { | ||
"type": "opencollective", | ||
"url": "https://opencollective.com/ory", | ||
"logo": "https://opencollective.com/ory/logo.txt" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Swagger Codegen Ignore | ||
# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen | ||
|
||
# Use this file to prevent files from being overwritten by the generator. | ||
# The patterns follow closely to .gitignore or .dockerignore. | ||
|
||
# As an example, the C# client generator defines ApiClient.cs. | ||
# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: | ||
#ApiClient.cs | ||
|
||
# You can match any string of characters against a directory, file or extension with a single asterisk (*): | ||
#foo/*/qux | ||
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux | ||
|
||
# You can recursively match patterns against a directory, file or extension with a double asterisk (**): | ||
#foo/**/qux | ||
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux | ||
|
||
# You can also negate patterns with an exclamation (!). | ||
# For example, you can ignore all files in a docs folder with the file extension .md: | ||
#docs/*.md | ||
# Then explicitly reverse the ignore rule for a single file: | ||
#!docs/README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
2.2.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
language: node_js | ||
node_js: | ||
- "6" | ||
- "6.1" | ||
- "5" | ||
- "5.11" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
# ory_oathkeeper | ||
|
||
OryOathkeeper - JavaScript client for ory_oathkeeper | ||
ORY Oathkeeper is a reverse proxy that checks the HTTP Authorization for validity against a set of rules. This service uses Hydra to validate access tokens and policies. | ||
This SDK is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: | ||
|
||
- API version: Latest | ||
- Package version: Latest | ||
- Build package: io.swagger.codegen.languages.JavascriptClientCodegen | ||
For more information, please visit [https://www.ory.am](https://www.ory.am) | ||
|
||
## Installation | ||
|
||
### For [Node.js](https://nodejs.org/) | ||
|
||
#### npm | ||
|
||
To publish the library as a [npm](https://www.npmjs.com/), | ||
please follow the procedure in ["Publishing npm packages"](https://docs.npmjs.com/getting-started/publishing-npm-packages). | ||
|
||
Then install it via: | ||
|
||
```shell | ||
npm install ory_oathkeeper --save | ||
``` | ||
|
||
##### Local development | ||
|
||
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing | ||
into the directory containing `package.json` (and this README). Let's call this `JAVASCRIPT_CLIENT_DIR`. Then run: | ||
|
||
```shell | ||
npm install | ||
``` | ||
|
||
Next, [link](https://docs.npmjs.com/cli/link) it globally in npm with the following, also from `JAVASCRIPT_CLIENT_DIR`: | ||
|
||
```shell | ||
npm link | ||
``` | ||
|
||
Finally, switch to the directory you want to use your ory_oathkeeper from, and run: | ||
|
||
```shell | ||
npm link /path/to/<JAVASCRIPT_CLIENT_DIR> | ||
``` | ||
|
||
You should now be able to `require('ory_oathkeeper')` in javascript files from the directory you ran the last | ||
command above from. | ||
|
||
#### git | ||
# | ||
If the library is hosted at a git repository, e.g. | ||
https://github.com/GIT_USER_ID/GIT_REPO_ID | ||
then install it via: | ||
|
||
```shell | ||
npm install GIT_USER_ID/GIT_REPO_ID --save | ||
``` | ||
|
||
### For browser | ||
|
||
The library also works in the browser environment via npm and [browserify](http://browserify.org/). After following | ||
the above steps with Node.js and installing browserify with `npm install -g browserify`, | ||
perform the following (assuming *main.js* is your entry file, that's to say your javascript file where you actually | ||
use this library): | ||
|
||
```shell | ||
browserify main.js > bundle.js | ||
``` | ||
|
||
Then include *bundle.js* in the HTML pages. | ||
|
||
### Webpack Configuration | ||
|
||
Using Webpack you may encounter the following error: "Module not found: Error: | ||
Cannot resolve module", most certainly you should disable AMD loader. Add/merge | ||
the following section to your webpack config: | ||
|
||
```javascript | ||
module: { | ||
rules: [ | ||
{ | ||
parser: { | ||
amd: false | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
|
||
## Getting Started | ||
|
||
Please follow the [installation](#installation) instruction and execute the following JS code: | ||
|
||
```javascript | ||
var OryOathkeeper = require('ory_oathkeeper'); | ||
|
||
var api = new OryOathkeeper.DefaultApi() | ||
|
||
var callback = function(error, data, response) { | ||
if (error) { | ||
console.error(error); | ||
} else { | ||
console.log('API called successfully. Returned data: ' + data); | ||
} | ||
}; | ||
api.getWellKnown(callback); | ||
|
||
``` | ||
|
||
## Documentation for API Endpoints | ||
|
||
All URIs are relative to *http://localhost* | ||
|
||
Class | Method | HTTP request | Description | ||
------------ | ------------- | ------------- | ------------- | ||
*OryOathkeeper.DefaultApi* | [**getWellKnown**](docs/DefaultApi.md#getWellKnown) | **GET** /.well-known/jwks.json | Returns well known keys | ||
*OryOathkeeper.HealthApi* | [**isInstanceAlive**](docs/HealthApi.md#isInstanceAlive) | **GET** /health/alive | Check the Alive Status | ||
*OryOathkeeper.HealthApi* | [**isInstanceReady**](docs/HealthApi.md#isInstanceReady) | **GET** /health/ready | Check the Readiness Status | ||
*OryOathkeeper.JudgeApi* | [**judge**](docs/JudgeApi.md#judge) | **GET** /judge | Judge if a request should be allowed or not | ||
*OryOathkeeper.RuleApi* | [**createRule**](docs/RuleApi.md#createRule) | **POST** /rules | Create a rule | ||
*OryOathkeeper.RuleApi* | [**deleteRule**](docs/RuleApi.md#deleteRule) | **DELETE** /rules/{id} | Delete a rule | ||
*OryOathkeeper.RuleApi* | [**getRule**](docs/RuleApi.md#getRule) | **GET** /rules/{id} | Retrieve a rule | ||
*OryOathkeeper.RuleApi* | [**listRules**](docs/RuleApi.md#listRules) | **GET** /rules | List all rules | ||
*OryOathkeeper.RuleApi* | [**updateRule**](docs/RuleApi.md#updateRule) | **PUT** /rules/{id} | Update a rule | ||
*OryOathkeeper.VersionApi* | [**getVersion**](docs/VersionApi.md#getVersion) | **GET** /version | Get the version of Oathkeeper | ||
|
||
|
||
## Documentation for Models | ||
|
||
- [OryOathkeeper.AuthenticationDefaultSession](docs/AuthenticationDefaultSession.md) | ||
- [OryOathkeeper.AuthenticationOAuth2ClientCredentialsRequest](docs/AuthenticationOAuth2ClientCredentialsRequest.md) | ||
- [OryOathkeeper.AuthenticationOAuth2ClientCredentialsSession](docs/AuthenticationOAuth2ClientCredentialsSession.md) | ||
- [OryOathkeeper.AuthenticationOAuth2IntrospectionRequest](docs/AuthenticationOAuth2IntrospectionRequest.md) | ||
- [OryOathkeeper.AuthenticationOAuth2Session](docs/AuthenticationOAuth2Session.md) | ||
- [OryOathkeeper.Authenticator](docs/Authenticator.md) | ||
- [OryOathkeeper.HealthNotReadyStatus](docs/HealthNotReadyStatus.md) | ||
- [OryOathkeeper.HealthStatus](docs/HealthStatus.md) | ||
- [OryOathkeeper.InlineResponse401](docs/InlineResponse401.md) | ||
- [OryOathkeeper.IntrospectionResponse](docs/IntrospectionResponse.md) | ||
- [OryOathkeeper.JsonWebKey](docs/JsonWebKey.md) | ||
- [OryOathkeeper.JsonWebKeySet](docs/JsonWebKeySet.md) | ||
- [OryOathkeeper.OAuth2ClientCredentialsAuthentication](docs/OAuth2ClientCredentialsAuthentication.md) | ||
- [OryOathkeeper.OAuth2IntrospectionAuthentication](docs/OAuth2IntrospectionAuthentication.md) | ||
- [OryOathkeeper.Rule](docs/Rule.md) | ||
- [OryOathkeeper.RuleHandler](docs/RuleHandler.md) | ||
- [OryOathkeeper.RuleMatch](docs/RuleMatch.md) | ||
- [OryOathkeeper.Session](docs/Session.md) | ||
- [OryOathkeeper.SwaggerCreateRuleParameters](docs/SwaggerCreateRuleParameters.md) | ||
- [OryOathkeeper.SwaggerGetRuleParameters](docs/SwaggerGetRuleParameters.md) | ||
- [OryOathkeeper.SwaggerListRulesParameters](docs/SwaggerListRulesParameters.md) | ||
- [OryOathkeeper.SwaggerRuleResponse](docs/SwaggerRuleResponse.md) | ||
- [OryOathkeeper.SwaggerRulesResponse](docs/SwaggerRulesResponse.md) | ||
- [OryOathkeeper.SwaggerUpdateRuleParameters](docs/SwaggerUpdateRuleParameters.md) | ||
- [OryOathkeeper.Upstream](docs/Upstream.md) | ||
- [OryOathkeeper.Version](docs/Version.md) | ||
|
||
|
||
## Documentation for Authorization | ||
|
||
All endpoints do not require authorization. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# OryOathkeeper.AuthenticationDefaultSession | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**allowed** | **Boolean** | Allowed is true if the request is allowed and false otherwise. | [optional] | ||
**sub** | **String** | Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. | [optional] | ||
|
||
|
10 changes: 10 additions & 0 deletions
10
sdk/js/swagger/docs/AuthenticationOAuth2ClientCredentialsRequest.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# OryOathkeeper.AuthenticationOAuth2ClientCredentialsRequest | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**id** | **String** | Token is the token to introspect. | [optional] | ||
**scope** | **[String]** | Scope is an array of scopes that are required. | [optional] | ||
**secret** | **String** | | [optional] | ||
|
||
|
9 changes: 9 additions & 0 deletions
9
sdk/js/swagger/docs/AuthenticationOAuth2ClientCredentialsSession.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# OryOathkeeper.AuthenticationOAuth2ClientCredentialsSession | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**allowed** | **Boolean** | Allowed is true if the request is allowed and false otherwise. | [optional] | ||
**sub** | **String** | Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. | [optional] | ||
|
||
|
9 changes: 9 additions & 0 deletions
9
sdk/js/swagger/docs/AuthenticationOAuth2IntrospectionRequest.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# OryOathkeeper.AuthenticationOAuth2IntrospectionRequest | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**scope** | **[String]** | Scope is an array of scopes that are required. | [optional] | ||
**token** | **String** | Token is the token to introspect. | [optional] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# OryOathkeeper.AuthenticationOAuth2Session | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
**allowed** | **Boolean** | Allowed is true if the request is allowed and false otherwise. | [optional] | ||
**aud** | **[String]** | | [optional] | ||
**clientId** | **String** | ClientID is the id of the OAuth2 client that requested the token. | [optional] | ||
**exp** | **Date** | ExpiresAt is the expiry timestamp. | [optional] | ||
**iat** | **Date** | IssuedAt is the token creation time stamp. | [optional] | ||
**iss** | **String** | Issuer is the id of the issuer, typically an hydra instance. | [optional] | ||
**nbf** | **Date** | | [optional] | ||
**scope** | **String** | GrantedScopes is a list of scopes that the subject authorized when asked for consent. | [optional] | ||
**session** | **{String: Object}** | Session represents arbitrary session data. | [optional] | ||
**sub** | **String** | Subject is the identity that authorized issuing the token, for example a user or an OAuth2 app. This is usually a uuid but you can choose a urn or some other id too. | [optional] | ||
**username** | **String** | | [optional] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# OryOathkeeper.Authenticator | ||
|
||
## Properties | ||
Name | Type | Description | Notes | ||
------------ | ------------- | ------------- | ------------- | ||
|
||
|
Oops, something went wrong.