Fetch the effective Policy Bundle for the user
Fetch the effective Policy Bundle for the user
client.PolicyBundle.Get(ctx, query) (*Response, error)
GET/policy/bundle
Returns the effective Policy Bundle for the user identified by the zone-issued resource-scoped token. When no user-scope binding exists, one will be generated from the default set.
The response body is a binary archive in the codec selected via the
Accept header. The only codec supported today is
application/vnd.keycard.policy-bundle.v1+tar+gzip. Clients SHOULD send
an explicit Accept header; absent one, the server defaults to the
tar+gzip codec.
Supports conditional fetch via If-None-Match: when the supplied ETag
matches the current bundle, the server responds 304 Not Modified with
no body.
Parameters
Returns
type PolicyBundleGetResponse interface{…}
Fetch the effective Policy Bundle for the user
package main
import (
"context"
"fmt"
"github.com/keycardai/keycard-go"
"github.com/keycardai/keycard-go/option"
)
func main() {
client := keycard.NewClient(
option.WithAPIKey("My API Key"),
)
policyBundle, err := client.PolicyBundle.Get(context.TODO(), keycard.PolicyBundleGetParams{
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", policyBundle)
}