Git Product home page Git Product logo

authing-golang-sdk's Introduction

License

English | 简体中文

You can use the Authing Golang SDK to quickly integrate authentication capabilities for new or existing Back End applications.

📚 Documentation

To check out documentation, please refers to docs.

This SDK is built upon Authing Management API(v3) and Authing Authentication API(v3), for older version, please refers to older version docs.

❓ Questions

For questions and support please use the official forum. The issue list of this repo is exclusively for bug reports and feature requests.

🤝 Contribution

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push -u origin my-new-feature)
  • Create new Pull Request

Thank you to all the people who already contributed to Golang SDK !

Contributing to Authing Open Source Repos

🎁 License

MIT

Copyright (c) 2019 Authing

authing-golang-sdk's People

Contributors

hard-it-le avatar lengyuxuan avatar liaochangjiang avatar lixpng avatar luojielin avatar willin avatar yunnysunny avatar zhaojj332 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

authing-golang-sdk's Issues

timeout参数不起作用

Description

managementClient, err := management.NewManagementClient(
		&management.ManagementClientOptions{
			AccessKeyId:     c.AccessKeyId,
			AccessKeySecret: c.AccessKeySecret,
			Timeout:         c.Timeout,
		},
	)

传入了Timeout=1之后,按理说api调用必定超时,但并未出现超时的情况

Bug: github.com/Authing/authing-golang-sdk/v3 v3.0.4 编译错误

Description

错误如下:

# github.com/Authing/authing-golang-sdk/v3/authentication
/root/go/pkg/mod/github.com/!authing/authing-golang-sdk/[email protected]/authentication/authentication_client.go:335:73: undefined: dto.IntrospectTokenResult
/root/go/pkg/mod/github.com/!authing/authing-golang-sdk/[email protected]/authentication/authentication_client.go:360:19: undefined: dto.IntrospectTokenResult

Minimal code-snippet showcasing the problem

Expected behavior

编译通过

Actual behavior

编译错误

Bug: management.ManagementClient 类的 CreateDepartment() 方法无法使用

Description

当我尝试使用文档中的方式去创建部门时,返回中出现了400错误。

Minimal code-snippet showcasing the problem

// 代码中隐藏了个人信息
manaOptions := management.ManagementClientOptions{
	AccessKeyId:     "xxx",
	AccessKeySecret: "xxx",
	Host:            "http://xxx.xxx.com",
}
client, err := management.NewManagementClient(&manaOptions)
if err != nil {
	panic(err)
}
reqDto := &dto.CreateDepartmentReqDto{
	OrganizationCode:   "xxx",
	OpenDepartmentId:   "ou_7dab8a3d3cdccxxxxxx777c7ad535d62",
	Name:               "开发部",
	Description:        "技术研发部门",
	ParentDepartmentId: "root",
}
respDto := client.CreateDepartment(reqDto)
fmt.Println(respDto)

Expected behavior

通过代码这对应的组织下创建根部门

Actual behavior

返回了如下错误:

&{400 zh-CN must be an object,en-US must be an object 0  {      []     0 false false {{{false } {false } {false } {false }}} <nil> [] [] false }}

Extra attempts

当我将库中的dto.LangObject中的字段zhCNenUS改为ZhCNEnUS(将对应字段转为公开字段),并在reqDto中加入I18n属性时(不加入I18n属性也可以),接口成功调用并且在Authing控制面板中成功看见创建的部门。代码如下:

// 代码中隐藏了个人信息
manaOptions := management.ManagementClientOptions{
	AccessKeyId:     "xxx",
	AccessKeySecret: "xxx",
	Host:            "http://xxx.xxx.com",
}
client, err := management.NewManagementClient(&manaOptions)
if err != nil {
	panic(err)
}
reqDto := &dto.CreateDepartmentReqDto{
	OrganizationCode:   "xxx",
	OpenDepartmentId:   "ou_7dab8a3d3cdccxxxxxx777c7ad535d62",
	Name:               "开发部",
	Description:        "技术研发部门",
	ParentDepartmentId: "root",
        I18n: dto.DepartmentI18nDto{Name: dto.LangObject{
		ZhCN: dto.LangUnit{Enabled: true, Value: "开发部"},
		EnUS: dto.LangUnit{Enabled: true, Value: "Development Department"},
	}},
}
respDto := client.CreateDepartment(reqDto)
fmt.Println(respDto)
package dto

type LangObject struct {
	// zhCN LangUnit `json:"zh-CN"`
	// enUS LangUnit `json:"en-US"`
	// zhTW LangUnit `json:"zh-TW"`
	// jaJP LangUnit `json:"ja-JP"`
        ZhCN LangUnit `json:"zh-CN"`
	EnUS LangUnit `json:"en-US"`
	ZhTW LangUnit `json:"zh-TW"`
	JaJP LangUnit `json:"ja-JP"`
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.