Git Product home page Git Product logo

duo_api_golang's People

Contributors

aaronatduo avatar adamrothman avatar artemkresling avatar axorna avatar bensallen avatar boyangz avatar bradleyhiggins avatar broamski avatar cavemanpi avatar eclipseo avatar geofftk avatar ianjwat avatar invlid avatar jaherne-duo avatar jeffreyparker avatar jordan-wright avatar kcarretto avatar logic avatar mbish avatar mvalani-sm avatar vbscott avatar yizshi avatar yohan460 avatar

Stargazers

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

Watchers

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

duo_api_golang's Issues

Admin & Log Funcs don't implement backoff & retry when 429 response received

Hey Duo!

We've noticed our service receiving 429 responses when hitting your APIs using the golang SDK. It looks like in the docs that the SDK should implement a backoff/retry but it looks like it doesn't. We'll handle this ourselves for now but thought you should know. Please advise.

https://help.duo.com/s/article/1338?language=en_US

func (c *Client) GetAdminLogs(mintime time.Time, options ...func(*url.Values)) (*AdminLogResult, error) {

func (c *Client) GetAuthLogs(mintime time.Time, window time.Duration, options ...func(*url.Values)) (*AuthLogResult, error) {

Signed call not working

Hi Duo team,

I've been trying to create admins using your Signed call function but I've been running into some errors. I pulled your code and pass in my information like so par := url.Values{} par.Set("name", "TestName") par.Set("email", "[email protected]") resp, _, err := duo.SignedCall("POST", "/admin/v1/admins", par)
problem is I get a 40103 error

    "code": 40103,
    "message": "Invalid signature in request credentials",
    "stat": "FAIL"
}```

I checked the sign function that creates the hmac signature 
and the conanicalized information is this 

```Mon, 05 Apr 2021 18:21:16 +0000
POST
api-xxxxxxxx.duosecurity.com
/admin/v1/admins
email=test%40test.com&name=TestName```
it  seems write but that hmac signature I get generated is wrong I've even tested on an online hmac generator and they don't match up. I haven't modified your code so I'm not sure where the error is coming from

CloudQuery Source Plugin?

Hi Team, hopefully this is right place to ask, if not, I'd appreciate if you can direct me.

I'm the founder of cloudquery.io, a high performance open source ELT framework.

Our users are interested in an Duo plugin, but as we cannot maintain all the plugins ourselves, I was curious if this would be an interesting collaboration, where we would help implement an initial source plugin version, and you will help maintain it.

This will give your users the ability to sync/ELT their Duo APIs (users/devices) to any of their datalakes/data-warehouses/databases easily using any of the growing list of CQ destination plugins.

Best,
Yevgeny

Addition of Activity Logs into SDK

Currently your SDK covers logs for telephony, auth and admin, which I'm currently using, but looking to expand to also include the Activity logs, and Trust Monitor.

Detailed Description

The addition of the Activity log endpoints into the sdk. Following same pattern as admin, auth and Telephony. Looking for similar attributes as the other types.

Use Case

Extremely similar to 3 other endpoints already in place, and looking to gather these logs as well.

Workarounds

Not currently using any Workarounds, don't want to mix the SDK and API calls in the same program.

Get "https://duo.com/": x509: certificate signed by unknown authority

Since the SDK doesn't have the capability to run CRUD operations on admins I was trying to make my own. heres my code

       d := duoapi.NewDuoApi(configInfo[0], configInfo[1], configInfo[2], "")
	params, _ := query.Values(admin)
	resp, _, err := d.SignedCall("GET", url, params)
	if err != nil {
		log.Fatal(err)
	}

It seems like the cert you have pinned when creating a newDuoApi isn't trusted

Option to provide CA roots

This SDK pins the root CA certificates:

certPool.AppendCertsFromPEM([]byte(duoPinnedCert))
If the user has a proxy terminating TLS, the cert validation step will always fail. Would it be possible to allow optionally configuring these certs when creating a new DuoApi object?

duo_test.go:26:47: conversion from int to string yields a string of one rune

Go 1.15 beta 1 on Fedora Rawhide

Testing    in: /builddir/build/BUILD/duo_api_golang-982114f7995f2fbee17bca19b206fa03e4cc4a12/_build/src
         PATH: /builddir/build/BUILD/duo_api_golang-982114f7995f2fbee17bca19b206fa03e4cc4a12/_build/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin
       GOPATH: /builddir/build/BUILD/duo_api_golang-982114f7995f2fbee17bca19b206fa03e4cc4a12/_build:/usr/share/gocode
  GO111MODULE: off
      command: go test -buildmode pie -compiler gc -ldflags "-X github.com/duosecurity/duo_api_golang/version=0 -X github.com/duosecurity/duo_api_golang/version.commit=982114f7995f2fbee17bca19b206fa03e4cc4a12 -extldflags '-Wl,-z,relro -Wl,--as-needed  -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '"
      testing: github.com/duosecurity/duo_api_golang
github.com/duosecurity/duo_api_golang
# github.com/duosecurity/duo_api_golang
./duo_test.go:26:47: conversion from int to string yields a string of one rune
./duo_test.go:243:21: conversion from int to string yields a string of one rune
./duo_test.go:244:30: conversion from int to string yields a string of one rune
./duo_test.go:248:21: conversion from int to string yields a string of one rune
./duo_test.go:249:33: conversion from int to string yields a string of one rune
./duo_test.go:253:27: conversion from Duration (int64) to string yields a string of one rune
./duo_test.go:254:22: conversion from Duration (int64) to string yields a string of one rune
FAIL	github.com/duosecurity/duo_api_golang [build failed]

See golang/go#32479

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.