Skip to content

Commit 6788794

Browse files
committed
Release 0.4.4
1 parent df9c31c commit 6788794

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

Changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
Version 0.4.4 - released 2017-01-08
2+
-------------
3+
4+
- Improved authentication handling: You can now add basic auth credentials to db properties, eliminating need to authenticate each function call. Thanks to @leifg
5+
- This change makes a number of authenticated functions redundant. These functions have been deprecated and will be removed in release version 0.5
6+
17
Version 0.4.3 - released 2016-12-21
28
-------------
39

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ The connector also offers functions to manage users and admins. These functions
3030
have been implemented to support testing of authentication and most users will
3131
probably manage users through different tools.
3232

33-
Basic access authentication (basic auth) is currently the only supported
34-
authentication scheme.
33+
HTTP Basic access authentication (Basic auth) is currently the only supported authentication scheme.
3534

3635
## Supported platforms
3736

@@ -45,7 +44,7 @@ The module is [available in Hex](https://hex.pm/packages/couchdb_connector), the
4544

4645
```Elixir
4746
def deps do
48-
[{:couchdb_connector, "~> 0.4.3"}]
47+
[{:couchdb_connector, "~> 0.4.4"}]
4948
end
5049
```
5150

@@ -65,6 +64,16 @@ For the subsequent steps, let's assume that we work in iex and that we define th
6564
db_props = %{protocol: "http", hostname: "localhost", database: "couchdb_connector_dev", port: 5984}
6665
```
6766

67+
### Authentication
68+
69+
HTTP Basic authentication was first introduced in release version 0.3. Some versions and improvements later, the current best practice is to put the Basic auth credentials into the database properties like so:
70+
71+
```Elixir
72+
db_props = %{protocol: "http", hostname: "localhost", database: "couchdb_connector_dev", port: 5984, user: "username", password: "secret"}
73+
```
74+
75+
Support for this configuration feature has been introduced in release version 0.4.4. It relieves users from having to add the credentials to each authenticated function call. Authentication can now be dealt with once and in one place only.
76+
6877
### Create a database
6978

7079
```Elixir
@@ -254,8 +263,6 @@ The response would look similar to this:
254263
"rev" => "2-7b2f4edf07..."}}}
255264
```
256265

257-
Basic authentication is also supported for this update API.
258-
259266
### Delete a document
260267

261268
In order to delete a document, you have to pass in its current revision, the same way that you saw above for the update calls.
@@ -272,12 +279,6 @@ You should see a response like this:
272279
"{\"ok\":true,\"id\":\"42\",\"rev\":\"2-9b2e3bcc3752a3...\"}\n"
273280
```
274281

275-
Basic authentication information need to be put in the database properties:
276-
277-
```Elixir
278-
db_props = %{protocol: "http", hostname: "localhost", database: "couchdb_connector_dev", port: 5984, user: "admin", password: "secret"}
279-
```
280-
281282
### Delete a document — Response wrapped in a Map
282283

283284
Since release 0.4.2, there is also an implementation of the delete functionality in place that wraps the resopnse in a Map. It is located in the top level module Couchdb.Connector and its API is identical to the JSON/String version:

mix.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ defmodule Couchdb.Connector.Mixfile do
44
def project do
55
[
66
app: :couchdb_connector,
7-
version: "0.4.3",
7+
version: "0.4.4",
88
elixir: "~> 1.2",
99
build_embedded: Mix.env == :prod,
1010
start_permanent: Mix.env == :prod,

0 commit comments

Comments
 (0)