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

Create Getting-Started-with-Akka-http-signature.md #1

Merged
merged 14 commits into from
Aug 1, 2017
Merged

Create Getting-Started-with-Akka-http-signature.md #1

merged 14 commits into from
Aug 1, 2017

Conversation

fstoqnov
Copy link
Contributor

No description provided.


## Running the server

In order to run a local server one must first locally clone the [Read-write-web play repository](https://github.com/read-write-web/rww-play). After that the user must navigate to their local Rww-play directory and run git there. For more information on how to run the server and the exact command used refer to the [Rww-play README page](https://github.com/read-write-web/rww-play).
Copy link
Member

Choose a reason for hiding this comment

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

should be "run sbt there"

@@ -0,0 +1,232 @@
***

Copy link
Member

Choose a reason for hiding this comment

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

All of this section is about using Akka-http-signature as a client with an existing server. One implementation of the Http-signature protocol is rww-play (though it too could be using the akka-http-signature library as a client, and will in a future release)

> publishLocal
```

One can then import it into their scripts from inside the ammonite shell. The user should then be able to make a get on their local rww-play and check whether they can access a resource that has access control. This means that the user will need to make themselves a key.
Copy link
Member

Choose a reason for hiding this comment

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

When talking of the HTTP verb GET it is always good to capitalise it and put it inside code quotes like so: GET

Copy link
Member

Choose a reason for hiding this comment

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

I don't think that publishLocal of rww-play is that useful. It is not a library that is shared with other code. It makes sense for akka-http-signatures as that is a library that is shared.


## The Key Pair

A key pair is a pair formed from a Public and a Private key ----------- (more info on public and private keys ?)
Copy link
Member

Choose a reason for hiding this comment

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

look up asymmetric key cryptography on wikipedia, and summarise it in a sentence or two with a link to the article.

@ import Jena._
@ import Jena.ops._
```

Copy link
Member

Choose a reason for hiding this comment

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

In the original introduction to scripting with ammonite I showed the @ sign in order to help the new user see the difference betwen a command in ammonite and a response from the shell. But it is not very helpful to show those when the response is not important, as it makes copying and pasting the code into a shell difficult.

priv: java.security.interfaces.RSAPrivateKey = sun.security.rsa.RSAPrivateCrtKeyImpl@ffd26868
```

This command will generate a Public and Private key pair. As we can see only information about the Public key is being displayed in BigInt notation. The private key will be hidden from view - only the reference memory location will be shown.
Copy link
Member

Choose a reason for hiding this comment

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

It is not "BigInt" notation, it is "decimal notation". BigInt is the object that allows one in Java to have indefinitely long numbers.


From here many different representations can be shown of the modulus of the key.
One can show a String representation of the key modulus by using:
```scala
Copy link
Member

Choose a reason for hiding this comment

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

It is not really worth showing this notation as it was already shown above in a way.

The keys' moduli can also be displayed in hexadecimal format:

```scala
@ val hexaPublic = pub.getModulus.toString(16)
Copy link
Member

Choose a reason for hiding this comment

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

yes, so we have decimal and hexadecimal format/notation (not sure which)

The RSAKeys class' function .save() will return a String representation of the key in Base64 format

```scala
@ val basePublic = RSAKeys.save(pub)
Copy link
Member

Choose a reason for hiding this comment

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

save is not such a good name. You could open an issue on the akka repo, and suggest a better name. I'll think about it.

+Hz2EGrkpkM0Zr6yHfEmW/H8mrnMgNev+MxND2euKGR+QEjajfdTSTuN5qjglhQWtLN/cBKQfS51
YDS4qExuSVyPHYH2mEOuUTeVcdg7OOHAigjDdI73XtfssBbQyEJrMMjFBgoI+H9nZLDsFGZ81vDa
oSRBVwIDAQAB"""
```
Copy link
Member

Choose a reason for hiding this comment

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

but it is certainly worth noting that this is mime type based hexadecimal notation used in the PEM format readable by OpenSSL.

oSRBVwIDAQAB"""
```

Keys can also be given different references:
Copy link
Member

Choose a reason for hiding this comment

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

the point of this exercise was not to make a new reference to the key, but to show that one can convert the key to a PEM formatted string and then convert it back to the same == object by reading that string. Ie. one can use the same public key another day.

@@ -0,0 +1,232 @@
***
Copy link
Member

@bblfish bblfish Jul 28, 2017

Choose a reason for hiding this comment

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

The whole section needs to explain what is being explained in this wiki page which is: using the library from a client perspective to authenticate using http-signature spec to a server in order to access a protected resource.

This requires:

  1. making a public-private key pair
  2. storing the private key locally for future re-use
  3. publishing the public key on some web server (we will publish it on the local rww-play server)
  4. changing the acl of a resource to restrict access to the person owning that key
  5. then accessing that resource with that key using http-signature

This will then help people understand the structure of the wiki

This will save the contents of the key in String format within the file found by following the specified path in .pem files.

### Transforming a Key into a Pointed Graph

Copy link
Member

Choose a reason for hiding this comment

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

the general title of this section should be "saving the public key to rdf"

The current implementation of rww-play recognises public keys deployed using the cert ontology.


defined object Cert

@ import Cert._
Copy link
Member

Choose a reason for hiding this comment

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

It would be worth putting all of the above in a script.

Copy link
Member

@bblfish bblfish left a comment

Choose a reason for hiding this comment

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

The document needs to be structured nicely so that a reader can understand why he is reading this, follow easily, and be directed to further documentation.

Also quite a few bugs need to be fixed.

val modulus = property[Array[Byte]](cert.modulus)

implicit val binder: PGBinder[Rdf, RSAPublicKey] =
pgb[RSAPublicKey](modulus, exponent)(
Copy link
Member

Choose a reason for hiding this comment

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

note this pgb function takes two functions,

  1. the first one that constructs a rsa public key from a modulus and expoent, the first one a byte array I think, (which is built from a the hexdecimal literal
  2. the second one constructs a pair that is then used to produce the rdf using the cert exponent and cert modulus properties shown above.

```scala
@ val keyGraph = pub.toPG

keyGraph: PointedGraph[Jena] = org.w3.banana.PointedGraph$$anon$1@7f8fa63d
Copy link
Member

Choose a reason for hiding this comment

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

it is worth no longer using Jena but Rdf as I do in the scripts on the ammonite page in the second part of the doc. This allows one to switch between Jena and Sesame easily.

One can then retrieve both the pointer and the graph:

```scala
@ keyJenGraph = keyGraph.graph
Copy link
Member

Choose a reason for hiding this comment

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

rename therefore to keyPG

@ keyJenPointed = keyGraph.pointer

keyJenPointed: Jena#Node = 5880.026289.0-02638.0-6288.0-06411.0-23110.021178.029228.0
```
Copy link
Member

Choose a reason for hiding this comment

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

Here you need to state that the pointer is an automatically generated and not very beautiful blank node.
As we wish to publish this key to the server in its own resource we want the name of the key not to be a blank node but a #uri and moreover a readable one. So we'd rather have the node be something like <#key> rather than 5880.026289.0-02638.0-6288.0-06411.0-23110.021178.029228.0 .

This should be a simple operation part of banana-rdf, but is not, so I opened an issue for that issue 325: renaming a pointed graph. I also have written out some initial code there that you can add to the explanation showing the result.

Then you can move onto serialising the PG and moving it to the server.


keyJenPointed: Jena#Node = 5880.026289.0-02638.0-6288.0-06411.0-23110.021178.029228.0
```
The user can then choose to view this graph in a different format - like turtle for example. In order to do that however, more external libraries are required:
Copy link
Member

Choose a reason for hiding this comment

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

"The user can choose to view, ...." yes, but let's stay focused here. We are focused on trying to publish this key on a server. So the user can publish this graph on the web in one of the well known RDF formats.


### Attaching Public keys to a File/URI

One can use the cp or the mv Ammonite commands to move the public key file into the test_www directory which resides within the rww-play directory. The process of attaching the file, containing the key to a URI is very similar.
Copy link
Member

Choose a reason for hiding this comment

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

always put commands in backtick quotes so the reader knows these are terms from the computing space so cp or mv

@ cp(wd/"publicKey.ttl" , wd/"rww-play"/"test_www"/"pubKey.ttl")
```

The Akka-http-signature library makes use of symbolic links when accessing the public keys. One can make a symbolic link to their public key file using the following commands in the bash console:
Copy link
Member

Choose a reason for hiding this comment

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

no, it's not the akka-http-signature lib, it is rww-play that uses symbolic links to indicate the default representation for a document. I gave you a pointer to how this is done on other servers, and which explains the content-negotiation that occurs in http. You can do a quick explanation of that here. The point of such a paragraph would be to explain how this setup is complex and different for each type of server. We will in the next section then show how LDP gives us a way to do the same thing without knowing how the server is set up.

```
### Access Control

Currently in order to manipulate the access control one must manually edit the .acl.ttl file. To do this, one must navigate to the test_www directory (or the server that contains the Key files) and look for the correct file. After that in order to permit access to the , the user must comment out the following:
Copy link
Member

Choose a reason for hiding this comment

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

No, you don't need to edit the .acl.ttl files on rww-play. You can also use HTTP PATCH or other methods there to do the same. We start with editing the file system, in order to make clear what in this case the requests we are going to make are going to change. Also we want to first test that we can do Access control at all.


```bash
acl:agentClass <http://xmlns.com/foaf/0.1/Agent>; => # acl:agentClass <http://xmlns.com/foaf/0.1/Agent> ;
```
Copy link
Member

Choose a reason for hiding this comment

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

you need to explain in english that what we are doing there is commenting out the line that gives access to everyone. This is currently explained in the web access control draft spec which I have not read carefully mind you, but we should point to it.

acl:agentClass <http://xmlns.com/foaf/0.1/Agent>; => # acl:agentClass <http://xmlns.com/foaf/0.1/Agent> ;
```
After that, the access to the Key files specified will be restricted. And therefore they will not be usable via the symbolic link created earlier.

Copy link
Member

Choose a reason for hiding this comment

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

ah ok. I just think the => notation above is not that clear. I would show the larger piece of code around that part, as otherwise the one line does not make sense: You are missing the subject of the triples.


keyPG: RDF#Graph = {5880.026289.0-02638.0-6288.0-06411.0-23110.021178.029228.0 http://www.w3.org/ns/auth/cert#exponent "65537"^^http://www.w3.org/2001/XMLSchema#integer; 5880.026289.0-02638.0-6288.0-06411.0-23110.021178.029228.0 @http://www.w3.org/ns/auth/cert#modulus "00937adccd722bc982aed4847872b81e36b890bca13166714bc2befe4d8547b6218ecd2da1eb020198a4ea00e4db6757c7dda738ec8db8b3bf211d3a3a17e196a2035bc4c79d06d8a581487d9f49e86374712b10ef500dfa242a20cab52911e2636c9d99b21fe9768ef2381989a25dc8b0b7a46531249aac27c4b8ab451a19d5fbdfa5f78b0deac9778c7ff87cf6106ae4a6433466beb21df1265bf1fc9ab9cc80d7aff8cc4d0f67ae28647e4048da8df753493b8de6a8e0961416b4b37f7012907d2e756034b8a84c6e495c8f1d81f69843ae51379571d83b38e1c08a08c3748ef75ed7ecb016d0c8426b30c8c5060a08f87f6764b0ec14667cd6f0daa1244157"^^http://www.w3.org/2001/XMLSchema#hexBinary}

keyRDFPointer = keyGraph.pointer
Copy link
Member

Choose a reason for hiding this comment

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

here you need both the @ and to set val = since you are looking to see the results of running the command.

```scala
object Cert {

implicit val rsaClassUri = classUrisFor[RSAPublicKey](cert.RSAPublicKey)
Copy link
Member

Choose a reason for hiding this comment

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

way too much white space in this whole code snippet. Please put 3 white spaces for indentation.

The Akka-Http-Signature library uses asymmetrical cryptography. As detailed in the [Public-Key cryptography wikipedia page](https://en.wikipedia.org/wiki/Public-key_cryptography), this is a cryptographic system that uses pairs of private and public keys. Public keys can be looked up by anyone and private keys are only known by the owner. Communication is this system is achieved the following way:
1. The sender encrypts a message using the public key of the receiver
1. The receiver gets the message and can decrypt it by using his own private key.
The message sent can only be decrypted via the private key of the receiver.
Copy link
Member

@bblfish bblfish Jul 28, 2017

Choose a reason for hiding this comment

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

There are two ways to use symmetric key encryption. One of them to encrypt messages, which you describe here shortly. The other to sign messages. We are using the second one in HTTP-Signature to sign the headers of HTTP messages. So you chose the wrong one.

Please replace with the usage that is relevant to the example here.

```scala
@ val hexaPublic = pub.getModulus.toString(16)

hexaModul : String = "937adccd722bc982aed4847872b81e36b890bca13166714bc2befe4d8547b6218ecd2da1eb020198a4ea00e4db6757c7dda738ec8db8b3bf211d3a3a17e196a2035bc4c79d06d8a581487d9f49e86374712b10ef500dfa242a20cab52911e2636c9d99b21fe9768ef2381989a25dc8b0b7a46531249aac27c4b8ab451a19d5fbdfa5f78b0deac9778c7ff87cf6106ae4a6433466beb21df1265bf1fc9ab9cc80d7aff8cc4d0f67ae28647e4048da8df753493b8de6a8e0961416b4b37f7012907d2e756034b8a84c6e495c8f1d81f69843ae51379571d83b38e1c08a08c3748ef75ed7ecb016d0c8426b30c8c5060a08f87f6764b0ec14667cd6f0daa1244157"
Copy link
Member

@bblfish bblfish Jul 28, 2017

Choose a reason for hiding this comment

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

The return value no longer matches the one set above (hexaPublic)


### Saving a public Key to RDF

A user can also transform his public keys to an RDF. In order to do this one must first import multiple files in order to resolve the required dependencies.
Copy link
Member

Choose a reason for hiding this comment

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

to an RDF format.

Copy link
Member

Choose a reason for hiding this comment

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

"In order ..."
We will use the banana binder library to show how this process can be done automatically and elegantly.

One can then retrieve both the pointer and the graph:

```scala
@ keyPG = keyGraph.graph
Copy link
Member

Choose a reason for hiding this comment

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

If it is just a graph why call it keyPG, which is the extension we use for pointed graph.
Also missing val

bblfish
bblfish previously approved these changes Jul 28, 2017
@bblfish bblfish dismissed their stale review July 28, 2017 17:43

pressed wrong button too soon.

```

As is evident, the pointer is an automatically generated Blank Node, which can be quite difficult to process. Because of this, it would be more optimal to change the pointer to not be a blank node but rather a #uri. The user can change the pointer manually by using a file editor into something simple - such as: *<#key>*

Copy link
Member

@bblfish bblfish Jul 28, 2017

Choose a reason for hiding this comment

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

It would be better to remove the above paragraph and instead in the section after the PG is created use the code I mentioned in my comment previously to change the node from a blank node to a named node.

see the comment before your previous commit

That has the advantage of removing one error prone manual operation, and make it easier to actually understand what we want to do at the semantic level, rather than doing it at the syntactic one, which would furthermore require explanation of how to do this correctly in each of the formats.

Try to integrate the code that I proposed in the issue I referenced there (the "rename" function).

cp(wd/"publicKey.ttl" , wd/"rww-play"/"test_www"/"pubKey.ttl")
```

The Rww-play library, which the Akka-http-signature library makes use of, uses symbolic links to indicate default representations of different documents. The Http content negotiation functionality is thus preserved. Http Content negotiation is a mechanism that is used for representing different representations of a resource at the same URI. The user can then specify which is best suited for them. This is quite a complex mechanism and the setup for it can vary greatly between different servers.
Copy link
Member

@bblfish bblfish Jul 28, 2017

Choose a reason for hiding this comment

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

  1. rww-play is not a library but a web server. It should be turned into a few light weight libs but that is a job still to do.
  2. the effects of content negotiation are preserved because one can link to files such as <card#me> and not be forced to link to <card.rdf#me> or <card.ttl#me> which would tie the name of the object described by #me in the pointed graph of the document to a particular serialisation format. Read the https://www.w3.org/TR/swbp-vocab-pub/ and see if you can use the above and explain this in a paragraph. The point of having the symbolic link is so that someone using an editor such as vi, emacs, or pico with a mode that could follow links, would be able to follow them on the file system too...

The mechanism is quite simple on the whole, but would be very complex if a client had to know in advance how each server does it - since they all do it differently.

```
### Access Control

Currently in order to manipulate the access control one can use `curl` and `PATCH` commands [As detailed in the rww-play wiki page](https://github.com/read-write-web/rww-play/wiki/Curl-Interactions).
Copy link
Member

Choose a reason for hiding this comment

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

It would be better to state with what people know about - editing config files on the server - and then move to the fact that this can be now done using PATCH or PUT as shown in the curl examples. So this paragraph aptly changed should come further down. Note that the doc on usage of curl also starts by explaining how the server stores its files first, then moves on to explain how one can use the web to change them.


# we allow authentication on the key too
<card#me> cert:key <key#> .

Copy link
Member

@bblfish bblfish Jul 28, 2017

Choose a reason for hiding this comment

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

That was wrong in the acl, so I removed it and replaced it with something that gives access to whatever agent can present the key.

Do a pull on rww-play to see the difference.

This allows the user to manipulate access control by simply commenting out `acl:agentClass <http://xmlns.com/foaf/0.1/Agent> ;`

After that, the access to the Key files specified will be restricted. And therefore they will not be usable via the symbolic link created earlier.

Copy link
Member

Choose a reason for hiding this comment

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

Here you can show the output from curl to proove it.

The Akka-Http-Signature library uses asymmetrical cryptography. As detailed in the [Public-Key cryptography wikipedia page](https://en.wikipedia.org/wiki/Public-key_cryptography), this is a cryptographic system that uses pairs of private and public keys. Public keys can be looked up by anyone and private keys are only known by the owner. Communication is this system is achieved the following way:
1. The sender signs the header of a message with the public key of the receiver
1. The receiver gets the message and can read it using his own private key.
The message sent can only be interpreted via the private key of the receiver.
Copy link
Member

Choose a reason for hiding this comment

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

Two lines above are wrong. This is basic public key crypto stuff. Please reread your course notes and Wikipedia articles on this carefully

2. The message can only be verified by clients that have access to that sender's public key

Because the messages are signed by the sender's private key and can only be verified via that sender's public key - only the intended clients (one that have access to said key) can ever receive the information within the message. This also ensures that the message is not changed in any way as the signature is bound to the original message and verification will fail if any alterations have occured.
Because the messages have headers that are signed by the sender's private key and can only be verified via that sender's public key - only the intended clients (one that have access to said key) can ever receive the information within the message. With the right signature, this cryptographic system can also ensure that the message is not changed in any way as the signature is bound to the original message and verification will fail if any alterations have occured.
Copy link
Member

Choose a reason for hiding this comment

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

only the intended clients (one that have access to said key) can ever receive the information within the message.

actually that is either true and an odd way of putting it, or false.
It is true because public key being public anyone can have access to it.
(It is true in in an HTTP message with a signature is sent over TLS, but that is due to TLS encryption of the channel )

So the question to you is: what headers have to be signed for there to be a garantee that the message was not altered?

This will return a String representation of the Pointed Graph in turtle format. This representation can also be saved on your local file system like so:

```scala
write(wd/"publicKey.ttl", RSAKeys.save(toTurtle))
Copy link
Member

Choose a reason for hiding this comment

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

This looks wrong to me. Have you tested this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I move the file later on

Copy link
Member

Choose a reason for hiding this comment

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

I think you can't pass a string to RSAKeys.save it either takes a public or private key.


Currently in order to manipulate the access control one can use `curl` and `PATCH` commands [As detailed in the rww-play wiki page](https://github.com/read-write-web/rww-play/wiki/Curl-Interactions).

To demonstrate how access control changes user permitted actions, one can also manually edit the .acl.ttl file. To do this, one must navigate to the test_www directory (or the server that contains the Key files) and look for the correct file. After that in order to permit access to the , the user must comment out the following:
Copy link
Member

@bblfish bblfish Jul 31, 2017

Choose a reason for hiding this comment

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

"Comment out the following" is much too vague.

You comment out the commented line (In Turtle, comments are whatever follows a # sign), and you comment out the line that follows it acl:agentClass which gives everyone permission. Ie: you want to restrict persmission to yourself.

```bash
$ curl -i -k https://localhost:8443/2013/pubKey.acl

curl: (7) Couldn't connect to server
Copy link
Member

@bblfish bblfish Jul 31, 2017

Choose a reason for hiding this comment

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

Try first to connect to https://localhost:8443/2013/card since that is the document whose acl we have changed, to see that it has. This may actually require restarting the server - it should not, but that's a bug.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did run It for card but the input was for the pubKey as that is the file weare dealing with (the output should be the same I assume)



<> acl:include <.acl> .
```
Copy link
Member

Choose a reason for hiding this comment

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

Please also remove all the unnecessary extra white spaces above. It is important for readability to keep as much on one page so the reader can avoid scrolling.

One can then represent the rdf of the key in turtle format:

```scala
@ val toTurtle = turtleWriter.asString(finalKeyPGGraph.graph,"").get
Copy link
Member

Choose a reason for hiding this comment

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

This won't work. The types are wrong.

@@ -270,7 +270,7 @@ $ ln -s pubKey.ttl pubKey

Currently in order to manipulate the access control one can use `curl` and `PATCH` commands [As detailed in the rww-play wiki page](https://github.com/read-write-web/rww-play/wiki/Curl-Interactions).

To demonstrate how access control changes user permitted actions, one can also manually edit the .acl.ttl file. To do this, one must navigate to the test_www directory (or the server that contains the Key files) and look for the correct file. After that in order to permit access to the , the user must comment out the following:
To demonstrate how access control changes user permitted actions, one can also manually edit the .acl.ttl file. To do this, one must navigate to the test_www directory (or the server that contains the Key files) and look for the correct file. After that in order to permit access to the , the user must comment out the `acl:agentClass <http://xmlns.com/foaf/0.1/Agent> ;`. This expression gives everyone permission to access this file and by commenting it out the user makes sure access is restricted only to them.
Copy link
Member

Choose a reason for hiding this comment

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

"access to the , " ???
"access is restricted only to them" <- this means you give permission to everyone since "them" refers to the last thing you referred to in the sentence. People will guess what is meant, but documentation is not meant to be unecessarily require guessing.

<> acl:include <.acl> .
```

This allows the user to manipulate access control by simply commenting out `acl:agent [ cert:key <publicKey#key> ];`

After that, the access to the Key files specified will be restricted. And therefore they will not be usable via the symbolic link created earlier.

If one attempts to do so, via curl for example, they will be presented with the following error message:
If one now restarts the server and attempts to access the files, via curl for example, they will be presented with the following error message:

```bash
$ curl -i -k https://localhost:8443/2013/pubKey.acl
Copy link
Member

Choose a reason for hiding this comment

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

I think I mentioned that the first thing to start with is trying to access the file itself that we have access controlled.

$ curl -i -k https://localhost:8443/2013/card


```bash
$ curl -i -k https://localhost:8443/2013/pubKey.acl

curl: (7) Couldn't connect to server
HTTP/1.1 404 Not Found
Content-Type: text/plain; charset=utf-8
Copy link
Member

Choose a reason for hiding this comment

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

that is not the error code we are looking for. We were expecting an Authentacation Required error code. You are currently only getting a problem because you have probably forgot to set up the symbolic link. Instead of doing all of this, I would just add the rdf to the existing key file. That will make things a bit simpler.


## Introduction

In this section we will be describing how one gets started working with the Akka-Http library and its functionalities.
Copy link
Member

Choose a reason for hiding this comment

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

You never need to explain that the introduction is an introduction.


After that we will be explaining how to save the generated keys to different formats and how to save them to a file.

Finally we will look at how to run the rww-play server locally and manipulate access control of the files that contain the public and private keys.

Copy link
Member

Choose a reason for hiding this comment

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

All of the above is too pedestrian. You need to explain what HTTP Signature is for. Why do we need rww-play at all? Why do we need authentication that is more than password based?

@bblfish bblfish merged commit 44e2b8e into read-write-web:master Aug 1, 2017
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.

None yet

2 participants