项目作者: NicklasWallgren

项目描述 :
BankID SDK
高级语言: Go
项目地址: git://github.com/NicklasWallgren/bankid.git
创建时间: 2019-09-14T13:05:00Z
项目社区:https://github.com/NicklasWallgren/bankid

开源协议:

下载


BankID library

Build Status
Reviewdog
Go Report Card
GoDoc
Codacy Badge

A library for providing BankID services as an RP (Relying party).
Supports the latest v6 features.

To learn how to use the library, please refer to the documentation. There are some examples that may be useful as well.

Installation

The library can be installed through go get

  1. go get github.com/e-identification/bankid-go

Supported versions

We support the two major Go versions, which are 1.21 and 1.22 at the moment.

Features

  • Supports all v6.0 features

SDK

  1. // Creates new BankIDClient instance
  2. NewBankIDClient(configuration *configuration.Configuration) (*BankIDClient)
  3. // Initiates an authentication order
  4. (b BankIDClient) Authenticate(context context.Context, payload *AuthenticationPayload) (*AuthenticateResponse, error)
  5. // Initiates a phone authentication order
  6. (b BankIDClient) PhoneAuthenticate(context context.Context, payload *PhoneAuthenticationPayload) (*PhoneAuthenticateResponse, error)
  7. // Initiates a sign order
  8. (b BankIDClient) Sign(context context.Context, payload *SignPayload) (*SignResponse, error)
  9. // Initiates a phone sign order
  10. (b BankIDClient) PhoneSign(context context.Context, payload *PhoneSignPayload) (*PhoneSignResponse, error)
  11. // Collects the result of a sign or auth order using the orderRef as reference
  12. (b BankIDClient) Collect(context context.Context, payload *CollectPayload) (*CollectResponse, error)
  13. // Cancels an ongoing sign or auth order
  14. (b BankIDClient) Cancel(context context.Context, payload *CancelPayload) (*CancelResponse, error)

Unit tests

  1. go test -v -race $(go list ./...)

Code Guide

We use GitHub Actions to make sure the codebase is consistent (golangci-lint run) and continuously tested (go test -v -race $(go list ./...)). We try to keep comments at a maximum of 120 characters of length and code at 120.

Contributing

If you find any problems or have suggestions about this library, please submit an issue. Moreover, any pull request, code review and feedback are welcome.

License

MIT