Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

SudoRuleFind - unexpected value for field Ipaenabledflag: [TRUE] ([]interface {}) #3

Open
jonpjenkins opened this issue Aug 14, 2019 · 2 comments

Comments

@jonpjenkins
Copy link

The Sudorule struct is expecting Ipaenabledflag to be a bool, while FreeIPA returns a string of TRUE, causing this function to error.

package main import ( "crypto/tls" "fmt" "net/http" "github.com/tehwalris/go-freeipa/freeipa" ) func main() { tspt := &http.Transport{} client, err := freeipa.Connect("<host>", tspt, "<user>", "<pass>") if err != nil { panic(err) } resa, erra := client.SudoruleFind("", &freeipa.SudoruleFindArgs{}, &freeipa.SudoruleFindOptionalArgs{}) if erra != nil { fmt.Printf("Issue: %s\n", erra) return } }

Returns:
Issue: unexpected value for field Ipaenabledflag: [TRUE] ([]interface {})

@tehwalris
Copy link
Owner

The way that decoding is currently written makes it very difficult to add new handling for special cases without possibly breaking something. I'll have to rewrite that code in a more maintainable way before I can resolve this issue (and #8).

riton added a commit to ccin2p3/go-freeipa that referenced this issue Nov 12, 2021
@riton
Copy link

riton commented Nov 12, 2021

ccin2p3@f52fb71 should address this issue.

Warning: This is still in early development.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants