Skip to content
This repository has been archived by the owner on Oct 31, 2022. It is now read-only.

Commit

Permalink
Bump version to 0.19.1, write CHANGELOG.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MikMuellerDev committed Aug 10, 2022
1 parent 11a2f7e commit 73e942d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 37 deletions.
38 changes: 3 additions & 35 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,4 @@
## Changelog for v0.19.0
## Changelog for v0.19.1

- Added username & token label fetching when logging in via an authentication token
- This means you can obtain the username even though a token was used to authenticate
- In order to get the username and token label, two additional public functions have been implemented (*demonstrated in the code example below*)
- Removed usages of the deprecated `ioutil` package
- This release is required because one error change inside the error "`ENUMS`"
- This is a significant change and should be made public.
- Because of the above facts, this release exists

### Code Example (*Obtaining username + token label*)
```go
package main

import (
"fmt"

"github.com/smarthome-go/sdk"
)

const URL = "http://smarthome.box"

func main() {
// === Example 1: Obtaining username & token-label === //
c, err := sdk.NewConnection(URL, sdk.AuthMethodQueryToken /* sdk.AuthMethodCookieToken */)
if err != nil {
panic(err.Error())
}
// Login with your user authentication token, to obtain one, visit `http://your-smarthome.box/profile`
if err := c.TokenLogin("807b2eded585803ff287c295afe23d1a"); err != nil {
panic(err.Error())
}
fmt.Println(c.GetUsername()) // This function works on all auth methods except `None`
fmt.Println(c.GetTokenClientLabel()) // This function only works when token auth is used
}
```
- **BUGFIX**: The auth mode `CookieToken` was broken and is now fixed
- The cookies were neither received nor appended which caused a `invalid credentials` error on any connection function after the inital login
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version := 0.19.0
version := 0.19.1

test:
go test -v -race .
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sdk

// Specifies the SDK version
const Version = "0.19.0"
const Version = "0.19.1"

// Specifies the oldest Smarthome version this SDK can connect to
const MinSmarthomeVersion = "0.0.55"

0 comments on commit 73e942d

Please sign in to comment.