Skip to content
Docs

Get User Security Settings

client.User.Security.Get(ctx) (*UserSecurity, error)
GET/v1/user/security

Get the current user’s security settings

ReturnsExpand Collapse
type UserSecurity struct{…}

User security settings response.

IP filter rules.

Allowed []string

List of IPv4 CIDR addresses to allow.

Blocked []string

List of IPv4 CIDR addresses to deny.

CreatedAt TimeOptional

When the user security settings were created.

formatdate-time
UpdatedAt TimeOptional

When the user security settings were updated.

formatdate-time

Get User Security Settings

package main

import (
  "context"
  "fmt"

  "github.com/nirvana-labs/nirvana-go"
  "github.com/nirvana-labs/nirvana-go/option"
)

func main() {
  client := nirvana.NewClient(
    option.WithAPIKey("My API Key"),
  )
  userSecurity, err := client.User.Security.Get(context.TODO())
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", userSecurity.SourceIPRule)
}
{
  "source_ip_rule": {
    "allowed": [
      "192.168.1.0/24",
      "10.0.0.0/8"
    ],
    "blocked": [
      "192.168.1.100/32"
    ]
  },
  "created_at": "2025-01-01T00:00:00Z",
  "updated_at": "2025-01-01T00:00:00Z"
}
Returns Examples
{
  "source_ip_rule": {
    "allowed": [
      "192.168.1.0/24",
      "10.0.0.0/8"
    ],
    "blocked": [
      "192.168.1.100/32"
    ]
  },
  "created_at": "2025-01-01T00:00:00Z",
  "updated_at": "2025-01-01T00:00:00Z"
}