Skip to content

Commit

Permalink
Enable Markdown linting on Travis
Browse files Browse the repository at this point in the history
* Add Markdown Lint
* Fix Dead links & etc.
* Add md checker to travis
* Format additional markdown files.
  • Loading branch information
jason-fox committed Mar 2, 2019
1 parent 5ac77f3 commit 5bb71eb
Show file tree
Hide file tree
Showing 12 changed files with 3,308 additions and 1,819 deletions.
3 changes: 3 additions & 0 deletions .remarkrc.js
@@ -0,0 +1,3 @@
exports.settings = { bullet: '-', paddedTable: true };

exports.plugins = [require('./node_modules/remark-preset-lint-recommended')];
9 changes: 3 additions & 6 deletions .textlintrc
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
19 changes: 10 additions & 9 deletions .travis.yml
Expand Up @@ -3,8 +3,8 @@ sudo: required
dist: xenial

node_js:
- "8"
- "10"
- "8"
- "10"

branches:
only:
Expand All @@ -14,17 +14,18 @@ services:
- mysql

install:
- npm 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
- 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
- npm run lint:text
- npm run lint
- npm run lint:text
- npm run lint:md

after_script:
- npm run test:coveralls
28 changes: 14 additions & 14 deletions README.md
Expand Up @@ -175,11 +175,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 @@ -218,18 +218,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.md
Expand Up @@ -109,8 +109,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
4 changes: 2 additions & 2 deletions doc/eidas/register_service_provider.md
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
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
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
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
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

0 comments on commit 5bb71eb

Please sign in to comment.