Core 1828 Docs Migration- Security: Topic and Subtopics#4
Conversation
| @@ -0,0 +1,64 @@ | |||
| # Authentication | |||
|
|
|||
| HarperDB utilizes Basic Auth to secure our REST requests. In the context of an HTTP transaction, **basic access authentication** is a method for an HTTP user agent to provide a user name and password when making a request. | |||
There was a problem hiding this comment.
Maybe reword this to say its one type of auth we use - we also utilize JWTs
| Below is a code sample from HarperDB Studio. On Line 14 you will see where we are adding the authorization header to each request. Again this needs to be added for each and every REST request for HarperDB. | ||
|
|
||
| ```bash | ||
| function callHarperDB(call_object,operation, callback){ |
There was a problem hiding this comment.
Do you think we should update this code to something more modern? async/await... not use var etc
There was a problem hiding this comment.
yes, whole page needs a rewrite. turning to draft
|
|
||
|
|
||
|
|
||
| ## Using HarperDB Studio |
There was a problem hiding this comment.
Im confused by this part, why is HarperDB Studio under basic auth?
|
|
||
| 1) Open the HarperDB harperdb.config file this can be found in /HDB_ROOT, the location you specified during install. | ||
|
|
||
| 2) In harperdb.config there should be 2 entries under `operationsApi.network`: cors and corsWhitelist. |
There was a problem hiding this comment.
White list has been update to access list
There was a problem hiding this comment.
This applies to all corsWhitelist ref
|
|
||
|
|
||
|
|
||
| HarperDB automatically generates a certificate and a privateKey file which live at `HDB_ROOT/keys/`. |
There was a problem hiding this comment.
we dont use HDB_ROOT anymore, maybe use <ROOTPATH>
| @@ -0,0 +1,96 @@ | |||
| # JWT Authentication | |||
|
|
|||
| HarperDB introduced Token based authentication in version 2.3.0 with JWTs. | |||
There was a problem hiding this comment.
I dont think we need this line anymore
|
|
||
| ## Token Expiration | ||
|
|
||
| `operation_token` expires at a set interval. Once it expires it will no longer be accepted by HarperDB. This duration defaults to one day, and is configurable in [harperdb.conf](https://harperdb.io/docs/reference/configuration-file/). To generate a new `operation_token`, the `refresh_operation_token` operation is used, passing the `refresh_token` in the Bearer Token Authorization Header. A full cURL example can be seen here: |
There was a problem hiding this comment.
config file is now harperdb-config.yaml
| } | ||
| ``` | ||
|
|
||
| The `refresh_token` also expires at a set interval, but a longer interval. Once it expires it will no longer be accepted by HarperDB. This duration defaults to thirty days, and is configurable in [harperdb.conf](https://harperdb.io/docs/reference/configuration-file/). To generate a new `operation_token` and a new `refresh_token` the `create_authentication_tokensoperation` is called. |
|
|
||
| Token timeouts are configurable in [harperdb.conf](https://harperdb.io/docs/reference/configuration-file/) with the following parameters: | ||
|
|
||
| * `OPERATION_TOKEN_TIMEOUT`: Defines the length of time until the operation_token expires (default 1d). |
There was a problem hiding this comment.
these params are from old config
| @@ -0,0 +1,282 @@ | |||
| # Users & Roles | |||
|
|
|||
| *Role Permissions documentation below for HarperDB version 2.2.0 and above.* | |||
There was a problem hiding this comment.
I dont think you need this line, we are way past 2.2.0
| @@ -0,0 +1,64 @@ | |||
| # Authentication | |||
|
|
|||
| HarperDB utilizes Basic Auth to secure our REST requests. In the context of an HTTP transaction, **basic access authentication** is a method for an HTTP user agent to provide a user name and password when making a request. | |||
There was a problem hiding this comment.
"our REST requests" -> "our HTTP requests"
|
|
||
|
|
||
|
|
||
| A header is added to each REST request. The header key is **“Authorization”** the header value is **“Basic <<your username and password buffer token>>”** |
There was a problem hiding this comment.
"each REST request" -> "each HTTP request"
Same with rest of the doc, won't tag each one.
|
|
||
| ## Using HarperDB Studio | ||
|
|
||
| Below is a code sample from HarperDB Studio. On Line 14 you will see where we are adding the authorization header to each request. Again this needs to be added for each and every REST request for HarperDB. |
There was a problem hiding this comment.
Can we literally just include line 14? Also, that line is node specific. The appropriate cross-platform code for the header is (that should work in browsers):
{ Authorization: "Basic " + btoa(username + ':' + password) }
There was a problem hiding this comment.
I can see using the whole function for context (simplified and modernized); I can also see using a cross-platform approach and just using line 14. This whole page needs to be rewritten; I wasn't aware of that until after I sent this PR. With the rewrite, I will solve this issue.
|
|
||
| ## CORS | ||
|
|
||
| HarperDB allows for managing [cross-origin HTTP requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS). By default, HarperDB enables CORS for all domains if you need to disable CORS completely or set up whitelisted domains you can do the following: |
There was a problem hiding this comment.
"set up whitelisted domains" -> "set up an access list of domains"
|
|
||
|
|
||
|
|
||
| These default ports can be changed by updating the `operationsApi.network.port` value in `HDB_ROOT/harperdb.config` |
There was a problem hiding this comment.
HDB_ROOT/harperdb.config -> HDB_ROOT/harperdb-config.yaml
There was a problem hiding this comment.
Change the root var here also
|
|
||
|
|
||
|
|
||
| By default, HTTPS is turned off and HTTP is turned on. |
There was a problem hiding this comment.
By default, HTTPS is turned off and HTTP is turned on. However, it is recommended that you never directly expose HarperDB's HTTP interface through a publicly available port. HTTP is intended for local or private network use.
| @@ -1 +1,9 @@ | |||
| # Security | |||
|
|
|||
| HarperDB uses role-based, attribute-level security to ensure that users can only gain access to the data they’re supposed to be able to access. Our granular permissions allow for unparalleled flexibility and control, and can actually lower the Total Cost of Ownership compared to other database solutions, since you no longer have to replicate subsets of your data to isolate use cases. | |||
There was a problem hiding this comment.
I understand the effort to emphasize TCO, but total cost of ownership really isn't a proper noun, I don't think (shouldn't be capitalized).
|
|
||
|
|
||
|
|
||
| **Database Manipulation**: A role defines CRUD permissions against database resources (i.e. data) in a HarperDB instance. |
There was a problem hiding this comment.
Probably define acronym on first use: "create, read, update, and delete (CRUD)"
|
|
||
| * `role` name used to easily identify the role assigned to individual users. | ||
|
|
||
| *Important: starting with 3.0, roles are assigned to users and altered/dropped based on the role name used in and returned from a successful `add_role` , `alter_role`, or `list_roles` operation.* |
There was a problem hiding this comment.
How far back do we have to mention "starting with"?
|
|
||
| Example JSON for `add_role` request | ||
|
|
||
| ```bash |
* added mac, added/updated windows, added/updated node version requirements, and added offline docs * go requirements * docs adjustments * testing variable usage * testing variable usage * Update other.md Update installation for other operating systems. * added link to download * node version * exact replica download button * functional download link * deleted old link * node version Co-authored-by: Kris Zyp <kriszyp@gmail.com>
* added mac, added/updated windows, added/updated node version requirements, and added offline docs * 1/3 through studio subtopics * 2/3 through studio subtopics * 3/3 through studio subtopics * corrected harperdb operations api * removed icon descriptions and fixed typos * removed icon descriptions * primary key vs hash_attribute change * primary key vs hash attribute qualifier
* testing variable syntax * testing variable syntax * testing variable syntax * testing variable syntax * testing variable syntax * testing variable syntax * testing variable syntax * testing variable syntax * testing variable syntax * testing variable syntax * testing variable syntax * testing variable syntax * testing variable syntax * testing variable syntax * testing variable syntax * testing variable syntax * reverted changes from variable testing * added diagrams and clustering docs * more formatting * formatted the rest of clustering docs * Core 1828 Docs Migration- Security: Topic and Subtopics (#4) * doc migration epic branch * 3/4 progress of security * finished configuration.md, began users and roles * users and roles migrated; still needs updates * updated user and roles operations * corrections to security docs * CORE-1825 Add/Update "install harpedb" subtopics (#1) * added mac, added/updated windows, added/updated node version requirements, and added offline docs * go requirements * docs adjustments * testing variable usage * testing variable usage * Update other.md Update installation for other operating systems. * added link to download * node version * exact replica download button * functional download link * deleted old link * node version Co-authored-by: Kris Zyp <kriszyp@gmail.com> * Core 1826 add/update harperdb studio topic and subtopics (#2) * added mac, added/updated windows, added/updated node version requirements, and added offline docs * 1/3 through studio subtopics * 2/3 through studio subtopics * 3/3 through studio subtopics * corrected harperdb operations api * removed icon descriptions and fixed typos * removed icon descriptions * primary key vs hash_attribute change * primary key vs hash attribute qualifier * minor change to example function Co-authored-by: Kris Zyp <kriszyp@gmail.com> * added more context to clustering intro page; adjusted subscription behavior description Co-authored-by: Kris Zyp <kriszyp@gmail.com>
This PR migrates Topic: Security and its subtopics. I updated operations in tables in Subtopic: users and roles.
This is the link to this page currently: https://harperdb.io/docs/security/users-roles/