Skip to content

Commit e60adb8

Browse files
wtrockiraymondfeng
authored andcommitted
fix: apply style changes to the docs
1 parent 55ef8b1 commit e60adb8

File tree

11 files changed

+193
-190
lines changed

11 files changed

+193
-190
lines changed

README.md

Lines changed: 53 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -14,74 +14,77 @@ looking to the `team` for an opinion of where to start.
1414
The components in this architecture are what we recommend to help internal
1515
and external customers get started based on our experience. Other components may be equally
1616
good, but these are the ones we know best and have the most experience with.
17-
* Where possible the opinion is based on what we've used internally and in our customer engagements.
18-
* The components specified will be our first priority for our contributions to open source projects in the JavaScript ecosystem.
19-
* Due to the above these are the components the `team` is best positioned when working with internal and external customers.
17+
18+
- Where possible the opinion is based on what we've used internally and in our customer engagements.
19+
- The components specified will be our first priority for our contributions to open source projects in the JavaScript ecosystem.
20+
- Due to the above these are the components the `team` is best positioned when working with internal and external customers.
2021
However, we do not include formal support for these components in any of our support offerings unless specifically identified
2122
in those offerings.
22-
* The recommended components may change over time as technologies and approaches change.
23+
- The recommended components may change over time as technologies and approaches change.
2324

2425
### The team
2526

2627
The `team` consists of engineers from across groups within IBM and Red Hat who:
2728

28-
* are actively engaged in the JavaScript/Node.js community
29-
* have large Javascript/Node.js deployments
30-
* provide consulting advice and/or development related to JavaScript/Node.js for customers
31-
* develop/deliver JavaScript or Node.js components
29+
- are actively engaged in the JavaScript/Node.js community
30+
- have large Javascript/Node.js deployments
31+
- provide consulting advice and/or development related to JavaScript/Node.js for customers
32+
- develop/deliver JavaScript or Node.js components
3233

3334
### Key tenets
3435

35-
* Whenever possible components should have been validated at scale within the `team's`
36+
- Whenever possible components should have been validated at scale within the `team's`
3637
JavaScript/Node.js deployments or in engagements with our customers.
37-
* We need to consider licensing and other due diligence when selecting components.
38-
* We are going to start with a focus on the back-end, a similar effort for front-end
38+
- We need to consider licensing and other due diligence when selecting components.
39+
- We are going to start with a focus on the back-end, a similar effort for front-end
3940
components will make sense as a follow on.
4041

4142
## Components
4243

4344
The reference architecture covers the following components (currently a work in progress
4445
with only a subset of sections having recommendations):
4546

46-
* Functional Components
47-
* [Web Framework](./docs/functional-components/webframework.md)
48-
* [Template Engines](./docs/functional-components/template-engines.md)
49-
* [Message Queuing](./docs/functional-components/message-queuing.md)
50-
* [Internationalization](./docs/functional-components/internationalization.md)
51-
* Accessibility
52-
* API Definition
53-
* Databases
54-
* [Authentication and Authorization](./docs/functional-components/auth.md)
55-
* Caching
56-
* Multi-threading
57-
* Consuming Services
58-
* Node versions/images
59-
* Transactions_handling
60-
61-
* Development
62-
* Static Assets
63-
* Keeping up to date
64-
* Code Quality
65-
* [Code Consistency](./docs/development/code-consistency.md)
66-
* Testing
67-
* References to CI/CD
68-
* Npm Mirroring
69-
* Secure Development Process
70-
71-
* Operations
72-
* [Health Checks](./docs/operations/healthchecks.md)
73-
* Monitoring/Metrics
74-
* Monitoring
75-
* [Metrics Collection](./docs/operations/metrics.md)
76-
* Distributed Tracing
77-
* Problem Determination
78-
* [Logging](./docs/operations/logging.md)
79-
* Rollout
80-
* Deployment
81-
* Containers
82-
* Serverless
83-
* Load-balancing
84-
* [Failure Handling](./docs/operations/failurehandling.md)
47+
- Functional Components
48+
49+
- [Web Framework](./docs/functional-components/webframework.md)
50+
- [Template Engines](./docs/functional-components/template-engines.md)
51+
- [Message Queuing](./docs/functional-components/message-queuing.md)
52+
- [Internationalization](./docs/functional-components/internationalization.md)
53+
- Accessibility
54+
- API Definition
55+
- Databases
56+
- [Authentication and Authorization](./docs/functional-components/auth.md)
57+
- Caching
58+
- Multi-threading
59+
- Consuming Services
60+
- Node versions/images
61+
- Transactions_handling
62+
63+
- Development
64+
65+
- Static Assets
66+
- Keeping up to date
67+
- Code Quality
68+
- [Code Consistency](./docs/development/code-consistency.md)
69+
- Testing
70+
- References to CI/CD
71+
- Npm Mirroring
72+
- Secure Development Process
73+
74+
- Operations
75+
- [Health Checks](./docs/operations/healthchecks.md)
76+
- Monitoring/Metrics
77+
- Monitoring
78+
- [Metrics Collection](./docs/operations/metrics.md)
79+
- Distributed Tracing
80+
- Problem Determination
81+
- [Logging](./docs/operations/logging.md)
82+
- Rollout
83+
- Deployment
84+
- Containers
85+
- Serverless
86+
- Load-balancing
87+
- [Failure Handling](./docs/operations/failurehandling.md)
8588

8689
## Contributing
8790

docs/development/code-consistency.md

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Code Consistency
22

3-
It is important to the efficiency of teams working
3+
It is important to the efficiency of teams working
44
on JavaScript (and other languages) to have consistency
55
in formatting within the projects managed by their team.
66

77
Not having a consistent coding style documented or enforcing
88
consistency manually as part of code reviews or
99
other manual techniques is error prone, potentially
10-
harmful to relationships between team members,
11-
is a barrier to attracting external contributions and can
10+
harmful to relationships between team members,
11+
is a barrier to attracting external contributions and can
1212
result in bugs because the is harder to understand and spot
1313
repeating patterns.
1414

@@ -24,69 +24,71 @@ needs of the team.
2424

2525
## Recommended Components
2626

27-
* ESLint - https://eslint.org/
27+
- ESLint - https://eslint.org/
2828

2929
ESLint is broadly used with the `teams` organizations and has broad usage
3030
across the JavaScript ecosystem with > 11 million weekly downlaods.
3131
It can be configured to reflect the coding style followed by most
32-
if not all teams.
32+
if not all teams.
3333

3434
# Guidance
3535

36-
* Use one of the pre-existing ESLint shareable configurations. There are a number
36+
- Use one of the pre-existing ESLint shareable configurations. There are a number
3737
of pre-existing configurations and re-using one of these has a number
3838
of benefits:
39-
40-
* minimizing what can be potentially divisive discussions to agree
39+
40+
- minimizing what can be potentially divisive discussions to agree
4141
on the style to be followed.
42-
* leveraging the experience of what has worked for other teams.
43-
* increasing the likelyhood of familiarity for new team members.
42+
- leveraging the experience of what has worked for other teams.
43+
- increasing the likelyhood of familiarity for new team members.
4444

4545
Examples include:
46-
* eslint-config-airbnb-standard - https://www.npmjs.com/package/eslint-config-airbnb-standard
47-
* eslint-config-semistandard - https://www.npmjs.com/package/eslint-config-semistandard
48-
* eslint-config-standard - https://www.npmjs.com/package/eslint-config-standard
49-
* eslint-config-prettier - https://github.com/prettier/prettier-eslint
46+
47+
- eslint-config-airbnb-standard - https://www.npmjs.com/package/eslint-config-airbnb-standard
48+
- eslint-config-semistandard - https://www.npmjs.com/package/eslint-config-semistandard
49+
- eslint-config-standard - https://www.npmjs.com/package/eslint-config-standard
50+
- eslint-config-prettier - https://github.com/prettier/prettier-eslint
5051

5152
with a complete list available through this query: https://www.npmjs.com/search?q=eslint-config-&ranking=popularity
5253

53-
* Integrate eslint into your package.json so that it runs before scripts. For example:
54+
- Integrate eslint into your package.json so that it runs before scripts. For example:
5455

5556
```json
5657
"scripts": {
5758
"pretest": "eslint --ignore-path .gitignore ."
5859
}
5960
```
6061

61-
* set your project to extend your chosen eslint-config-X by populating an eslintrc.json file:
62+
- set your project to extend your chosen eslint-config-X by populating an eslintrc.json file:
6263

6364
```
6465
echo '{"extends": "X"}' > .eslintrc.json
6566
```
6667

67-
substituting X with your chosen config. You can also get started by running `npx eslint --init` which
68+
substituting X with your chosen config. You can also get started by running `npx eslint --init` which
6869
will ask you a number of interactive questions and then create your `.eslintrc.json` file and add
6970
the required depenencies into your package.json.
7071

71-
* Ensure you have a gitignore file so derived files do not get linted. A minimal one can be
72+
- Ensure you have a gitignore file so derived files do not get linted. A minimal one can be
7273
created with:
7374

7475
```shell
7576
echo node_modules/ >> .gitignore
7677
```
7778

7879
Some additional useful suggestions are available in this
79-
[article](https://medium.com/the-node-js-collection/why-and-how-to-use-eslint-in-your-project-742d0bc61ed7).
80+
[article](https://medium.com/the-node-js-collection/why-and-how-to-use-eslint-in-your-project-742d0bc61ed7).
8081

81-
* When adopting a pre-existing shareable config it is important to understand that these
82+
- When adopting a pre-existing shareable config it is important to understand that these
8283
configs can change over time. Include time in your regular workflow to review these changes
8384
and update your code base appropriately.
8485

85-
* Configure hooks to run eslint before committing code, but ensure that this pre-commit check does not take too long to execute which may cause complaints from developers.
86-
* Use [husky](https://github.com/typicode/husky) to configure scripts to run before git commits and git pushes.
87-
* These checks can be skipped by a developer when needed via `git commit --no-verify`
88-
* Use [lint-staged](https://github.com/okonet/lint-staged) to reduce amount of code to be linted. This speeds up linting step before commit/push.
89-
These can be integrated into package.json as follows:
86+
- Configure hooks to run eslint before committing code, but ensure that this pre-commit check does not take too long to execute which may cause complaints from developers.
87+
88+
- Use [husky](https://github.com/typicode/husky) to configure scripts to run before git commits and git pushes.
89+
- These checks can be skipped by a developer when needed via `git commit --no-verify`
90+
- Use [lint-staged](https://github.com/okonet/lint-staged) to reduce amount of code to be linted. This speeds up linting step before commit/push.
91+
These can be integrated into package.json as follows:
9092

9193
```json
9294
"lint-staged": {
@@ -99,5 +101,4 @@ These can be integrated into package.json as follows:
99101
}
100102
```
101103

102-
* Always ensure CI/CD is running linting regardless of hooks.
103-
104+
- Always ensure CI/CD is running linting regardless of hooks.

docs/functional-components/auth.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,53 @@
22

33
## Recommended Components
44

5-
* Passport - http://www.passportjs.org/
5+
- Passport - http://www.passportjs.org/
66
Passport is authentication middleware for Node.js. Extremely flexible and modular, Passport can be unobtrusively dropped in to any Express-based web application. Is based on strategies which allows for a large number of integrations.
77

8-
* HelmetJS - https://helmetjs.github.io/
8+
- HelmetJS - https://helmetjs.github.io/
99
Helmet helps you secure your Express apps by setting various HTTP headers. It’s not a silver bullet, but it can help!
1010

11-
* IBM Cloud AppID https://cloud.ibm.com/docs/services/appid
11+
- IBM Cloud AppID https://cloud.ibm.com/docs/services/appid
1212
App ID helps developers to easily add authentication to their web and mobile apps with few lines of code, and secure their Cloud-native applications and services on IBM Cloud.
1313

14-
* Istio - https://istio.io/
14+
- Istio - https://istio.io/
1515
Istio provides a service mesh, includes security features https://istio.io/docs/tasks/security/
1616
IBM provides an Istio Adapter for App Identity and Access https://istio.io/docs/reference/config/policy-and-telemetry/adapters/app-identity-access-adapter/
1717

1818
## Guidance
1919

20-
* Use Helmet to configure http headers to address security attacks.
20+
- Use Helmet to configure http headers to address security attacks.
2121

22-
* Use Passport to handle your web strategy
22+
- Use Passport to handle your web strategy
2323

24-
* Use a web strategy based on AppID whenever possible.
24+
- Use a web strategy based on AppID whenever possible.
2525

26-
* There is a difference between a WebApp/BFF(Backend for Frontend) and a pure Backend API that never deals with a Frontend like a Web Browser. Knowning this difference will help you understand the requirements in terms of security.
26+
- There is a difference between a WebApp/BFF(Backend for Frontend) and a pure Backend API that never deals with a Frontend like a Web Browser. Knowning this difference will help you understand the requirements in terms of security.
2727

28-
* A Frontend WebApp should never handle end user credentials such as username/password, it should always delegate to an Authorization Server for example AppID service. https://github.com/ibm-cloud-security/appid-video-tutorials/blob/master/02a-simple-node-web-app/app.js
28+
- A Frontend WebApp should never handle end user credentials such as username/password, it should always delegate to an Authorization Server for example AppID service. https://github.com/ibm-cloud-security/appid-video-tutorials/blob/master/02a-simple-node-web-app/app.js
2929

30-
* A pure Backend API that never deals with a fronted should never be concern of redirecting or dealing with end users, they would require an access/AOI token or assume the proxy/gateway in front is already handling this and not require token at all. https://github.com/ibm-cloud-security/appid-video-tutorials/blob/master/02b-simple-node-backend-app/app.js
30+
- A pure Backend API that never deals with a fronted should never be concern of redirecting or dealing with end users, they would require an access/AOI token or assume the proxy/gateway in front is already handling this and not require token at all. https://github.com/ibm-cloud-security/appid-video-tutorials/blob/master/02b-simple-node-backend-app/app.js
3131

32-
* The browser/client should never have access to access token.
32+
- The browser/client should never have access to access token.
3333

34-
* The Authorization Server will interact with the user and once is authenticated it will return to the browser with a grant code, which in turn can be used by the Web App request an access token. With this access token the WebApp can access a Backend API for a resource.
34+
- The Authorization Server will interact with the user and once is authenticated it will return to the browser with a grant code, which in turn can be used by the Web App request an access token. With this access token the WebApp can access a Backend API for a resource.
3535

36-
* Use the refresh token whenever possible, this avoids re-authentication.
36+
- Use the refresh token whenever possible, this avoids re-authentication.
3737

38-
* Do not use OAUTH2 implicit grant, is preferred to use Authorization code workflow.
38+
- Do not use OAUTH2 implicit grant, is preferred to use Authorization code workflow.
3939

40-
* Use OIDC ID token for authentication, they are represented as JSON Web Token (JWT) and it contains the requested claims.
40+
- Use OIDC ID token for authentication, they are represented as JSON Web Token (JWT) and it contains the requested claims.
4141

42-
* When using Istio:
43-
* Istio Adapter for AppID can handle the authentication and authorization of the client, this leaves the nodejs service without the responsibilities of handling authentication or authorization. https://github.com/ibm-cloud-security/app-identity-and-access-adapter
42+
- When using Istio:
4443

45-
* Using Istio you can handle authorization based on roles for the nodejs service, for example all authenticated users can read data via http method GET, but only users with `role=admin` are allowed to write data via http method POST.
44+
- Istio Adapter for AppID can handle the authentication and authorization of the client, this leaves the nodejs service without the responsibilities of handling authentication or authorization. https://github.com/ibm-cloud-security/app-identity-and-access-adapter
4645

47-
## Learning Resources
46+
- Using Istio you can handle authorization based on roles for the nodejs service, for example all authenticated users can read data via http method GET, but only users with `role=admin` are allowed to write data via http method POST.
4847

49-
* [Technologies Under the Hood (OAuth2, OIDC, JWT, Bearer Token)](https://www.youtube.com/watch?v=ndlk-ZhKGXM&list=PLbAYXkuqwrX2WLQqR0LUtjT77d4hisvfK&index=2)
48+
## Learning Resources
5049

51-
* [Protecting Node.js Web Applications with IBM Cloud App ID](https://www.youtube.com/watch?v=6roa1ZOvwtw&list=PLbAYXkuqwrX2WLQqR0LUtjT77d4hisvfK&index=3)
50+
- [Technologies Under the Hood (OAuth2, OIDC, JWT, Bearer Token)](https://www.youtube.com/watch?v=ndlk-ZhKGXM&list=PLbAYXkuqwrX2WLQqR0LUtjT77d4hisvfK&index=2)
5251

53-
* [Protecting Node.js Backend Application with IBM Cloud App ID](https://www.youtube.com/watch?v=jJLSgkHpZwA&list=PLbAYXkuqwrX2WLQqR0LUtjT77d4hisvfK&index=4)
52+
- [Protecting Node.js Web Applications with IBM Cloud App ID](https://www.youtube.com/watch?v=6roa1ZOvwtw&list=PLbAYXkuqwrX2WLQqR0LUtjT77d4hisvfK&index=3)
5453

54+
- [Protecting Node.js Backend Application with IBM Cloud App ID](https://www.youtube.com/watch?v=jJLSgkHpZwA&list=PLbAYXkuqwrX2WLQqR0LUtjT77d4hisvfK&index=4)

0 commit comments

Comments
 (0)