Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs] Split into different sections #190

Merged
merged 16 commits into from Mar 16, 2018
Merged

[Docs] Split into different sections #190

merged 16 commits into from Mar 16, 2018

Conversation

eperinan
Copy link
Contributor

@eperinan eperinan commented Mar 7, 2018

This PR splits the current documentation into different sections and solves #176

This PR is related to frees-io/freestyle#534 where I am creating the entries for the menu. If we do some changes related to the paths, for example, we will have to do on both sides.

This PR resolves #179, #178 and #177

  • Split into different sections
  • Adds Compression Support
  • Adds SSL/TLS Encryption Support (Netty)
  • Adds fs2 Streaming docs
  • Check and reword pattern section
  • Review al compilation tut errors after split into different sections

@eperinan eperinan added the WIP label Mar 7, 2018
@eperinan eperinan self-assigned this Mar 7, 2018
permalink: /docs/rpc/implementations
---

# RPC Service Implementations
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd re-define this sections towards to be the Patterns one.

--- | --- | --- | ---
`frees-rpc-server` | Server | Yes | Needed to attach RPC Services and spin-up an RPC Server.
`frees-rpc-client-core` | Client | Yes | Mandatory to define protocols and auto-derived clients.
`frees-rpc-client-netty` | Client | Yes* | Optional if you use `OkHttp`, required from the client perspective.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not about the document split as such, but is this line accurate? I could see it meaning "netty is optional because if you use okhttp then you don't need to depend on netty" but it seems a bit confusing. I suggest changing it to just "Mandatory on the client side if using Netty". Same goes for the following line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. Changed description to "Mandatory on the client side if we are using Netty in the server side"

@@ -25,7 +25,7 @@ It's divided into multiple and different artifacts, grouped by scope:
--- | --- | --- | ---
`frees-rpc-server` | Server | Yes | Needed to attach RPC Services and spin-up an RPC Server.
`frees-rpc-client-core` | Client | Yes | Mandatory to define protocols and auto-derived clients.
`frees-rpc-client-netty` | Client | Yes* | Optional if you use `OkHttp`, required from the client perspective.
`frees-rpc-client-netty` | Client | Yes* | Mandatory on the client side if we are using Netty in the server side.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating - could you confirm if it's mandatory for the client implementation to match the server's though?

Also we'll want to adjust the following line in a similar way, for OkHttp. Thanks!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the matching it's mandatory.

@L-Lavigne
Copy link
Contributor

LGTM 👍

Copy link
Contributor

@L-Lavigne L-Lavigne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Various grammar fixes

@@ -191,22 +191,20 @@ We'll see more details about these and other annotations in the following sectio

## Compression

[frees-rpc] allows you to compress the datas in our services. We can enable this compression in the server or in the client side.
[frees-rpc] allows you to compress the data whose we are sending in our services. We can enable this compression either on the server or client side.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar fix:
[frees-rpc] allows us to compress the data we are sending in our services. We can enable this compression either on the server or the client side.


[frees-rpc] supports `Gzip` as compression format.
[frees-rpc] supports only `Gzip` as compression format so far and the usage it's really easy.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original line is fine here IMO

> [gRPC](https://grpc.io/docs/guides/auth.html) has SSL/TLS integration and promotes the use of SSL/TLS to authenticate the server, and encrypt all the data exchanged between the client and the server. Optional mechanisms are available for clients to provide certificates for mutual authentication.

[frees-rpc] allows you to encrypt the connection between the server and the client through SSL/TLS. The main goal of use SSL is protect your sensitive information and keeps your data secure between servers and clients.
Copy link
Contributor

@L-Lavigne L-Lavigne Mar 13, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar fix: replace of use SSL is protect to of using SSL is to protect

[frees-rpc] allows you to encrypt the connection between the server and the client through SSL/TLS. The main goal of use SSL is protect your sensitive information and keeps your data secure between servers and clients.

As we mentioned in the [Quickstart](/docs/rpc/quickstart) section, we can choose and configure our client with `okhttp` or `netty` but if we want to encrypt our service, it's mandatory to use `Netty`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should have consistent capitalization in the transport names here and below

On the server and client side, we will need two files to configure the `SslContext` in `gRPC`:

* Server certificate file: Small data files that digitally bind a cryptographic key to an organization’s details. This file could be generated or get from a third company.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grammar fix: change get to obtained.


## Usage

The first step to do, in order to start to secure ours `freestyle-rpc` services, is use the artifacts `frees-rpc-netty-ssl` and `frees-rpc-client-netty` in our `build.sbt`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first step to securing our freestyle-rpc services is to add the library dependencies frees-rpc-netty-ssl and frees-rpc-client-netty in our build.sbt.


In second place, we will have to move to our `resources` folder both server/client certificates and private keys.

In our tests, the certificates have been extracted from [here](https://github.com/grpc/grpc-java/tree/master/testing/src/main/resources/certs). It could be a good point to start to check that our application works meanwhile we generate or obtain our own certificates.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we haven't yet generated or obtained our own certificates, we can test using certificates found here.


Thirdly, let's see a piece of code where we will explain line by line, what we are doing on the server side.

We are going to ignore the explanations related to create the `RPCService`, `ServerRPCService` and runtime implicits. If you have any doubt about it, please, take a look at the [Patterns](/docs/rpc/patterns) section.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We won't cover the details regarding creation of RPCService, ServerRPCService and runtime implicits. You can find more information about these in the Patterns section.


// Important, the channel interpreter have to be NettyChannelInterpreter.

// In this case, we are creating the channel interpreter with a specifics ManagedChannelConfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// In this case, we are creating the channel interpreter with a specific ManagedChannelConfig

// Important, the channel interpreter have to be NettyChannelInterpreter.

// In this case, we are creating the channel interpreter with a specifics ManagedChannelConfig
// These configs allow us encrypted the connection with the server.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// These configs allow us to encrypt the connection with the server.

@L-Lavigne
Copy link
Contributor

LGTM, good work 👍

Note that we'll need to merge the docs changes from this and #195 once either of them is in master.

* Adds some changes to the core-concepts and streaming docs

* More fixes

* Adds suggestions

* More minor changes

* Fixes typos
Copy link
Member

@juanpedromoreno juanpedromoreno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Outstanding job @eperinan ! LGTM

@juanpedromoreno juanpedromoreno merged commit fe6c6de into master Mar 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs - Compression Support
3 participants