Skip to content

Commit 4d0aad7

Browse files
authored
Merge pull request #4 from StandUpCode/develop
Refactor: move file
2 parents 9aa4156 + 2041377 commit 4d0aad7

10 files changed

Lines changed: 37 additions & 38 deletions

File tree

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
👍 Contribute
2+
3+
1. Fork this repository
4+
2. Add your feature or bug fix
5+
3. Create a pull request
6+
4. Wait for review
7+
5. Merge the pull request
8+
6. Publish a release

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,18 @@
44

55
## Line Login Admin SDK is a library for [Line Login](https://developers.line.biz/en/docs/line-login/).
66
We provide a simple and easy to use SDK for developers to integrate Line Login with Go Backend.
7-
## Featues:
7+
## 🎯 Featues:
88
- `Verify AccesToken`
99
- `Get User Profile`
10-
1110
---
12-
## License
11+
## Installation
12+
```hell
13+
go get -u github.com/StandUpCode/LineLoginAdminSDK
14+
```
15+
16+
----
17+
## ⚠️ License
1318
Copyright (c) 2022-present Pattanan and Contributors. LineLoginAdminSDK is free and open-source software licensed under the MIT License. Official logo was created by Vic Shóstak and distributed under Creative Commons license (CC BY-SA 4.0 International).
1419

1520
Third-party library licenses
16-
- [net/http](https://pkg.go.dev/net/http)
21+
- [fasthttp](github.com/valyala/fasthttp)

VERSION_HISTORY.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
11
# Version History
22

3+
4+
## `Version 0.2.0`
5+
Released: `2022-04-04`
6+
## Improve:
7+
- change engine `net/http` -> `fasthttp`
8+
9+
## Feature:
10+
- Verify ID Token
11+
- Verify Access Token
12+
313
## `Version 0.0.1-alpha.`
414
Pre-release.
515
- Use net/http of api client.
616

7-
Feature:
17+
## Feature:
818
- Verify AccesToken Token

cmd/lineloginadminsdk/README.md

Lines changed: 0 additions & 2 deletions
This file was deleted.

cmd/lineloginadminsdk/app.go

Lines changed: 0 additions & 22 deletions
This file was deleted.

cmd/lineloginadminsdk/args.go

Lines changed: 0 additions & 1 deletion
This file was deleted.

model.go renamed to lineloginadmin/models/model.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lineloginadminsdk
1+
package models
22

33
type AccessTokenVerify struct {
44
ClientID string `json:"client_id"`
@@ -14,5 +14,5 @@ type IDTokenVerify struct {
1414
Name string `json:"name"`
1515
Picture string `json:"picture"`
1616
Amr []string `json:"amr"`
17-
email string `json:"email"`
17+
Email string `json:"email"`
1818
}

token.go renamed to lineloginadmin/token.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
package lineloginadminsdk
1+
package lineloginadmin
22

33
import (
44
"encoding/json"
55
"fmt"
66

7-
"github.com/StandUpCode/LineLoginAdminSDK/utils"
7+
"github.com/StandUpCode/LineLoginAdminSDK/lineloginadmin/models"
8+
"github.com/StandUpCode/LineLoginAdminSDK/lineloginadmin/utils"
89
)
910

1011
func VerifyAccessToken(accessToken string) error {
@@ -20,7 +21,7 @@ func VerifyAccessToken(accessToken string) error {
2021

2122
}
2223

23-
func VerifyIDToken(IDToken , ChannelID string) (*IDTokenVerify, error){
24+
func VerifyIDToken(IDToken , ChannelID string) (*models.IDTokenVerify, error){
2425

2526
uri := "https://api.line.me/oauth2/v2.1/verify"
2627
payload := fmt.Sprintf("id_token=%s&client_id=%s", IDToken, ChannelID)
@@ -31,7 +32,7 @@ func VerifyIDToken(IDToken , ChannelID string) (*IDTokenVerify, error){
3132
if err != nil {
3233
panic(err)
3334
}
34-
verify_response := IDTokenVerify{}
35+
verify_response := models.IDTokenVerify{}
3536
err = json.Unmarshal(result, &verify_response)
3637
if err != nil {
3738
//fmt.Printf("Error: %s", err)

token_test.go renamed to lineloginadmin/token_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package lineloginadminsdk
1+
package lineloginadmin
22

33
import (
44
"testing"
@@ -36,7 +36,7 @@ func TestVerifyIDToken(t *testing.T) {
3636
for _, data := range IDTestData {
3737
var err error
3838

39-
if _,err = VerifyIDToken(data.IDToken, data.ChannelID); err != nil {
39+
if _, err = VerifyIDToken(data.IDToken, data.ChannelID); err != nil {
4040
t.Errorf("Unable to verify accesstoken: %v", err)
4141
}
4242

0 commit comments

Comments
 (0)