Skip to content

Commit

Permalink
Combine updates (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
AleF83 authored Apr 23, 2020
1 parent bf1f246 commit 2982720
Show file tree
Hide file tree
Showing 52 changed files with 12,035 additions and 17,712 deletions.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ This is the sample of using the server in `docker-compose` configuration:
- "4011:80"
environment:
ASPNETCORE_ENVIRONMENT: Development
API_SCOPES_INLINE: |
[
"some-app-scope-1",
"some-app-scope-2"
]
API_RESOURCES_INLINE: |
[
"some-app"
{
"Name": "some-app",
"Scopes": ["some-app-scope-1", "some-app-scope-2"]
}
]
USERS_CONFIGURATION_INLINE: |
[
Expand Down Expand Up @@ -66,7 +74,20 @@ When `clients-config.json` is as following:
],
"AllowedScopes": [
"some-app"
],
"ClientClaimsPrefix": "",
"Claims": [
{
"Type": "string_claim",
"Value": "string_claim_value"
},
{
"Type": "json_claim",
"Value": "['value1', 'value2']",
"ValueType": "json"
}
]
}
]
```
Expand Down
26 changes: 25 additions & 1 deletion e2e/kubernetes/oidc-server-mock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,19 @@ spec:
image: soluto/oidc-server-mock
imagePullPolicy: Never
env:
- name: API_RESOURCES_INLINE
- name: API_SCOPES_INLINE
value: |
[
"user-service-scope"
]
- name: API_RESOURCES_INLINE
value: |
[
{
"Name": "user-service",
"Scopes": ["user-service-scope"]
}
]
- name: CLIENTS_CONFIGURATION_INLINE
value: |
[
Expand All @@ -35,13 +43,29 @@ spec:
],
"AllowedScopes": [
"user-service-scope"
],
"ClientClaimsPrefix": "",
"Claims": [
{
"Type": "string_claim",
"Value": "string_claim_value"
},
{
"Type": "json_claim",
"Value": "['value1', 'value2']",
"ValueType": "json"
}
]
}
]
livenessProbe:
httpGet:
path: /.well-known/openid-configuration
port: 80
resources:
limits:
cpu: 1
memory: 1000M
---
kind: Service
apiVersion: v1
Expand Down
22 changes: 13 additions & 9 deletions e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,22 @@
},
"license": "MIT",
"dependencies": {
"axios": "0.19.0",
"axios": "0.19.2",
"chai": "4.2.0",
"jsonwebtoken": "^8.5.1",
"querystring": "0.2.0",
"wait-on": "3.3.0"
"wait-on": "4.0.2"
},
"devDependencies": {
"@types/chai": "4.1.7",
"@types/mocha": "5.2.7",
"@types/node": "12.6.8",
"mocha": "6.2.0",
"ts-node": "8.3.0",
"tslint": "5.18.0",
"typescript": "3.5.3"
"@types/axios": "^0.14.0",
"@types/chai": "4.2.11",
"@types/jsonwebtoken": "^8.3.9",
"@types/mocha": "7.0.2",
"@types/node": "^12.12.37",
"@types/wait-on": "^4.0.0",
"mocha": "7.1.1",
"ts-node": "8.9.0",
"tslint": "6.1.1",
"typescript": "3.8.3"
}
}
7 changes: 5 additions & 2 deletions e2e/tests/test.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import axios from "axios";
import { expect } from "chai";
import * as querystring from "querystring";
import * as jwt from "jsonwebtoken";

describe("Test", () => {
it("should work", async () => {
Expand All @@ -18,7 +19,9 @@ describe("Test", () => {
expect(response).to.exist;
// tslint:disable-next-line:no-unused-expression
expect(response.data.access_token).to.exist;
// tslint:disable-next-line:no-unused-expression
expect(response.data.access_token).not.to.be.empty;
const token = jwt.decode(response.data.access_token);
expect(token['scope']).to.deep.equal([ 'user-service-scope' ])
expect(token['string_claim']).to.equal('string_claim_value');
expect(token['json_claim']).to.deep.equal(['value1', 'value2']);
});
});
Loading

0 comments on commit 2982720

Please sign in to comment.