Skip to content

Commit

Permalink
Merge 05bbef7 into 565a37a
Browse files Browse the repository at this point in the history
  • Loading branch information
jason-fox committed Mar 11, 2019
2 parents 565a37a + 05bbef7 commit c26b859
Show file tree
Hide file tree
Showing 10 changed files with 3,369 additions and 1,832 deletions.
9 changes: 3 additions & 6 deletions .textlintrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"DefinitelyTyped",
"EditorConfig",
"ESLint",
"FIWARE",
"GitHub",
"GraphQL",
"iOS",
Expand Down Expand Up @@ -164,7 +165,6 @@

// Starts from a lower case letter in the middle of a sentence
["(\\w+[^.?!]\\)? )base64", "$1base64"],
["(\\w+[^.?!]\\)? )internet", "$1internet"],
["(\\w+[^.?!]\\)? )stylelint", "$1stylelint"],
["(\\w+[^.?!]\\)? )webpack", "$1webpack"],
["(\\w+[^.?!]\\)? )npm", "$1npm"],
Expand All @@ -182,15 +182,12 @@
"passive": false,
"tooWordy": false,
"weasel": false,
"so": false
"so": false,
"thereIs": false
},
"no-dead-link": {
"ignoreRedirects": true,
"ignore": [
"http://mylogo.es/*",
"http://idm-host/**",
"http://localhost/**",
"http://localhost:",
"mailto:*",
"https://oauth.net"
]
Expand Down
87 changes: 65 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,73 @@
language: node_js
sudo: required
dist: xenial

node_js:
- "8"
- "10"

branches:
only:
- master

services:
- mysql
jobs:
include:
- stage: test
name: "Unit Tests: Node 8"
language: node_js
sudo: required
dist: xenial

node_js:
- "8"

services:
- mysql

install:
- npm install

before_install:
- sudo mysql -e "use mysql; update user set authentication_string=password('test') where user='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
- sudo mysql_upgrade -u root -ptest
- sudo service mysql restart
- cp test/config_test.js.template config.js

before_script:
- npm run lint

after_script:
- npm run test:coveralls

- stage: test
name: "Unit Tests: Node 10"
language: node_js
sudo: required
dist: xenial

node_js:
- "10"

services:
- mysql

install:
- npm install

before_install:
- sudo mysql -e "use mysql; update user set authentication_string=password('test') where user='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
- sudo mysql_upgrade -u root -ptest
- sudo service mysql restart
- cp test/config_test.js.template config.js

before_script:
- npm run lint

after_script:
- npm run test:coveralls

install:
- npm install
- stage: test
name: "Documentation Tests"
language: node_js

before_install:
- sudo mysql -e "use mysql; update user set authentication_string=password('test') where user='root'; update user set plugin='mysql_native_password';FLUSH PRIVILEGES;"
- sudo mysql_upgrade -u root -ptest
- sudo service mysql restart
- cp test/config_test.js.template config.js
node_js:
- "10"

before_script:
- npm run lint
- npm run lint:text
install:
- npm install

after_script:
- npm run test:coveralls
script:
- npm run lint:md
- npm run lint:text
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Identity Manager - Keyrock

[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c1f1239e878341b782be7ed9a67afdfd)](https://app.codacy.com/app/apozohue10/fiware-idm?utm_source=github.com&utm_medium=referral&utm_content=ging/fiware-idm&utm_campaign=Badge_Grade_Dashboard)
[![FIWARE Security](https://nexus.lab.fiware.org/repository/raw/public/badges/chapters/security.svg)](https://www.fiware.org/developers/catalogue/)
[![License: MIT](https://img.shields.io/github/license/ging/fiware-idm.svg)](https://opensource.org/licenses/MIT)
[![Docker badge](https://img.shields.io/docker/pulls/fiware/idm.svg)](https://hub.docker.com/r/fiware/idm/)
Expand All @@ -10,6 +9,7 @@
[![Build Status](https://travis-ci.org/ging/fiware-idm.svg?branch=master)](https://travis-ci.org/ging/fiware-idm)
[![Coverage Status](https://coveralls.io/repos/github/ging/fiware-idm/badge.svg?branch=master)](https://coveralls.io/github/ging/fiware-idm?branch=master)
![Status](https://nexus.lab.fiware.org/repository/raw/public/static/badges/statuses/keyrock.svg)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/c1f1239e878341b782be7ed9a67afdfd)](https://app.codacy.com/app/apozohue10/fiware-idm?utm_source=github.com&utm_medium=referral&utm_content=ging/fiware-idm&utm_campaign=Badge_Grade_Dashboard)

Keyrock is the FIWARE component responsible for Identity Management. Using
Keyrock (in conjunction with other security components such as
Expand Down Expand Up @@ -176,11 +176,11 @@ For performing a basic end-to-end test, you have to follow the next steps. A
detailed description about how to run tests can be found
[here](http://fiware-idm.readthedocs.org/en/latest/admin_guide#end-to-end-testing).

1. Verify that the host address of IdM can be reached. By default, web access
will show a Login Page.
2. Acquire a valid username and password and access with those credentials. The
resulting web page is the landing page of the IdM KeyRock Portal.
3. Verify that you can view the list of applications, organizations, etc.
1. Verify that the host address of IdM can be reached. By default, web access
will show a Login Page.
2. Acquire a valid username and password and access with those credentials. The
resulting web page is the landing page of the IdM KeyRock Portal.
3. Verify that you can view the list of applications, organizations, etc.

## Advanced Documentation

Expand Down Expand Up @@ -219,18 +219,18 @@ This project is part of [FIWARE](https://fiware.org/) and has been rated as
follows:

- **Version Tested:**
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Version&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.version&colorB=blue)
![](https://img.shields.io/badge/dynamic/json.svg?label=Version&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.version&colorB=blue)
- **Documentation:**
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Completeness&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.docCompleteness&colorB=blue)
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Usability&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.docSoundness&colorB=blue)
![](https://img.shields.io/badge/dynamic/json.svg?label=Completeness&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.docCompleteness&colorB=blue)
![](https://img.shields.io/badge/dynamic/json.svg?label=Usability&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.docSoundness&colorB=blue)
- **Responsiveness:**
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Time%20to%20Respond&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.timeToCharge&colorB=blue)
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Time%20to%20Fix&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.timeToFix&colorB=blue)
![](https://img.shields.io/badge/dynamic/json.svg?label=Time%20to%20Respond&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.timeToCharge&colorB=blue)
![](https://img.shields.io/badge/dynamic/json.svg?label=Time%20to%20Fix&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.timeToFix&colorB=blue)
- **FIWARE Testing:**
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Tests%20Passed&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.failureRate&colorB=blue)
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Scalability&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.scalability&colorB=blue)
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Performance&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.performance&colorB=blue)
![ ](https://img.shields.io/badge/dynamic/json.svg?label=Stability&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.stability&colorB=blue)
![](https://img.shields.io/badge/dynamic/json.svg?label=Tests%20Passed&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.failureRate&colorB=blue)
![](https://img.shields.io/badge/dynamic/json.svg?label=Scalability&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.scalability&colorB=blue)
![](https://img.shields.io/badge/dynamic/json.svg?label=Performance&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.performance&colorB=blue)
![](https://img.shields.io/badge/dynamic/json.svg?label=Stability&url=https://fiware.github.io/catalogue/json/keyrock.json&query=$.stability&colorB=blue)

---

Expand Down
4 changes: 2 additions & 2 deletions doc/eidas/register_service_provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ filled.

Once the application is registered, the metadata of the Service Provider is
exposed in the endpoint
http://idm-host/idm/applications/*application-id*/saml2/metadata. This metadata
file is needed for registering the Service Provider in the eIDAS node.
`http://idm-host/idm/applications/*application-id*/saml2/metadata`. This
metadata file is needed for registering the Service Provider in the eIDAS node.

**Note:** It is very important to register the Service Provider in the eIDAS
node following the specific instructions of the node owner. This instructions
Expand Down
57 changes: 38 additions & 19 deletions doc/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Connection:keep-alive
  2\. Create an application using API token previously created:

    2.1\. Request (check that redirect_uri is
http://localhost/login):
`http://localhost/login`):

```bash
curl --include \
Expand Down Expand Up @@ -134,21 +134,21 @@ curl --include \
    2.2\. Example response with application info. Save id
and secret to be used later to obtain an OAuth token.

```bash
```json
{
"application":{
"id":"a17bf9e3-628d-4000-8d25-37703975a528",
"secret":"ac5df1fe-4caf-4ae6-9d21-60f3a9182887",
"image":"default",
"jwt_secret":"51129f085f3e1a80",
"name":"Test_application 1",
"description":"description",
"redirect_uri":"http://localhost/login",
"url":"http://localhost",
"grant_type":"password,authorization_code,implicit",
"token_types":"jwt,permanent,bearer",
"response_type":"code,token"
}
"application": {
"id": "a17bf9e3-628d-4000-8d25-37703975a528",
"secret": "ac5df1fe-4caf-4ae6-9d21-60f3a9182887",
"image": "default",
"jwt_secret": "51129f085f3e1a80",
"name": "Test_application 1",
"description": "description",
"redirect_uri": "http://localhost/login",
"url": "http://localhost",
"grant_type": "password,authorization_code,implicit",
"token_types": "jwt,permanent,bearer",
"response_type": "code,token"
}
}
```

Expand All @@ -167,8 +167,14 @@ curl -X POST -H "Authorization: Basic $(echo -n $ID:$SECRET | base64 -w 0)" --
In the body of the response we can found the OAuth Token in "access_token"
parameter:

```bash
{"access_token":"cd8c8e41ab0db220315ed54f173087d281a4c686","token_type":"Bearer","expires_in":3599,"refresh_token":"8b96bc9dfbc8f1c0bd53e18720b6feb5b47de661","scope":["bearer"]}
```json
{
"access_token": "cd8c8e41ab0db220315ed54f173087d281a4c686",
"token_type": "Bearer",
"expires_in": 3599,
"refresh_token": "8b96bc9dfbc8f1c0bd53e18720b6feb5b47de661",
"scope": ["bearer"]
}
```

Last, you can retrieve information about the user who has generated the token
Expand All @@ -180,6 +186,19 @@ curl "http://localhost:3000/user?access_token=cd8c8e41ab0db220315ed54f173087d281

And Keyrock will send:

```bash
{"organizations":[],"displayName":"","roles":[],"app_id":"a17bf9e3-628d-4000-8d25-37703975a528","trusted_apps":[],"isGravatarEnabled":false,"email":"admin@test.com","id":"admin","authorization_decision":"","app_azf_domain":"","eidas_profile":{},"username":"admin"}
```json
{
"organizations": [],
"displayName": "",
"roles": [],
"app_id": "a17bf9e3-628d-4000-8d25-37703975a528",
"trusted_apps": [],
"isGravatarEnabled": false,
"email": "admin@test.com",
"id": "admin",
"authorization_decision": "",
"app_azf_domain": "",
"eidas_profile": {},
"username": "admin"
}
```
14 changes: 9 additions & 5 deletions doc/installation_and_administration_guide/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ users could be easily managed.
These are the basic configurations of Keyrock. The first configuration is to
indicate in which port will be Keyrock listenning if HTTPS is not enabled. Host
configuration is to indicate the domain name of Keyrock in prodoction. Otherwise
it should be set to "http://localhost:" when running on development.
it should be set to `http://localhost:` when running on development.

```javascript
config.port = 80;
Expand Down Expand Up @@ -256,9 +256,9 @@ database. These attributes are:

- password: the encrypted password of the user.

- password*salt: if not specified, the value set in
\_config.external_auth.password_encryption_key* will be used for checking
the password encryption.
- password_salt: if not specified, the value set in
`config.external_auth.password_encryption_key` will be used for checking the
password encryption.

It is very common that the external database does not have a table with these
parameters. In such case you can create a database view for exposing them.
Expand All @@ -268,23 +268,27 @@ _USERS_ and _ACTORS_ with the following structure:

**USERS Table**

```text
| ID | encrypted_password | password_salt | created_at | last_sign_in_at | actor_id |
| --- | ------------------ | ------------- | ------------------------ | ------------------------ | -------- |
| 1 | g34h432hjk54k2j | 1234 | 2015-06-10 08:26:02.0113 | 2018-06-10 08:26:02.0113 | 12 |
| 2 | 2h43h7fdj38302j | 1234 | 2015-01-10 08:26:02.0113 | 2018-01-10 08:26:02.0113 | 22 |
| 3 | j328478j328j423 | 1234 | 2015-02-10 08:26:02.0113 | 2018-10-10 08:26:02.0113 | 5 |
```

**ACTORS Table**

```text
| ID | name | email | logo |
| --- | ------------- | --------------- | ---------------------- |
| 12 | Melinda López | melinda@test.es | http://mylogo.es/12344 |
| 22 | Juanli Jons | juanli@test.es | http://mylogo.es/12121 |
| 5 | Lesha Magnen | lesha@test.es | http://mylogo.es/1212 |
```

You can create a view with the SQL statement

```
```sql
CREATE VIEW USER_VIEW AS
SELECT USERS.id, USERS.password_salt, USERS.encrypted_password as password, ACTORS.email, ACTORS.name as username
FROM USERS,ACTORS
Expand Down
18 changes: 9 additions & 9 deletions doc/installation_and_administration_guide/sanity_check.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ before proceeding to unit tests, integration tests and user validation.

Check if User Interface is working:

1. Verify that the host address of IdM can be reached. By default, web access
will show a Login Page.
1. Verify that the host address of IdM can be reached. By default, web access
will show a Login Page.

2. Acquire a valid username and password and access with those credentials. The
resulting web page is the landing page of the IdM KeyRock Portal.
2. Acquire a valid username and password and access with those credentials. The
resulting web page is the landing page of the IdM KeyRock Portal.

3. Verify that you can view the list of applications, organizations, etc.
3. Verify that you can view the list of applications, organizations, etc.

Check if API is working:

1. Request an API token as describe in
[apiary](https://keyrock.docs.apiary.io/#reference/keyrock-api/authentication/create-token-with-password-method).
2. Verify that you can retrieve list of applications, organization, etc. For
instance you can check paths by:
1. Request an API token as describe in
[apiary](https://keyrock.docs.apiary.io/#reference/keyrock-api/authentication/create-token-with-password-method).
2. Verify that you can retrieve list of applications, organization, etc. For
instance you can check paths by:

```bash
curl --include \
Expand Down
10 changes: 5 additions & 5 deletions extras/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ You can perform serveral actions using Docker:

In order to run the IdM Keyrock follow these steps:

1. Create a directory.
2. Create a new file called `docker-compose.yml` inside your directory with the
following code and:
1. Create a directory.
2. Create a new file called `docker-compose.yml` inside your directory with the
following code and:

```yml
version: "2"
Expand Down Expand Up @@ -73,8 +73,8 @@ The different params mean:
order to allow requests from it.
- IDM_DB_HOST. Define the name of the database container.

3. Use `sudo docker-compose up` to run the IdM Keyrock. This will automatically
download the two images and run the IdM Keyrock service.
3. Use `sudo docker-compose up` to run the IdM Keyrock. This will automatically
download the two images and run the IdM Keyrock service.

## Build your own image

Expand Down
Loading

0 comments on commit c26b859

Please sign in to comment.