This repository has been archived by the owner on Oct 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bump version to
0.19.1
, write CHANGELOG.md
- Loading branch information
1 parent
11a2f7e
commit 73e942d
Showing
3 changed files
with
5 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 . | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |