# User

## Get User Details

`$ nirvana user get`

**get** `/v1/user`

Get details about an authenticated user

### Returns

- `user: object { id, email, first_name, last_name }`

  User details.

  - `id: string`

    Unique identifier for the User.

  - `email: string`

    Email address of the user.

  - `first_name: string`

    First name of the user.

  - `last_name: string`

    Last name of the user.

### Example

```cli
nirvana user get \
  --api-key 'My API Key'
```

#### Response

```json
{
  "id": "123e4567-e89b-12d3-a456-426614174000",
  "email": "satoshi@nirvanalabs.io",
  "first_name": "Satoshi",
  "last_name": "Nakamoto"
}
```

## Domain Types

### User

- `user: object { id, email, first_name, last_name }`

  User details.

  - `id: string`

    Unique identifier for the User.

  - `email: string`

    Email address of the user.

  - `first_name: string`

    First name of the user.

  - `last_name: string`

    Last name of the user.

# Security

## Get User Security Settings

`$ nirvana user:security get`

**get** `/v1/user/security`

Get the current user's security settings

### Returns

- `user_security: object { source_ip_rule, created_at, updated_at }`

  User security settings response.

  - `source_ip_rule: object { allowed, blocked }`

    IP filter rules.

    - `allowed: array of string`

      List of IPv4 CIDR addresses to allow.

    - `blocked: array of string`

      List of IPv4 CIDR addresses to deny.

  - `created_at: optional string`

    When the user security settings were created.

  - `updated_at: optional string`

    When the user security settings were updated.

### Example

```cli
nirvana user:security get \
  --api-key 'My API Key'
```

#### Response

```json
{
  "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"
}
```

## Update User Security Settings

`$ nirvana user:security update`

**patch** `/v1/user/security`

Update the current user's security settings

### Parameters

- `--source-ip-rule: optional object { allowed, blocked }`

  IP filter rules.

### Returns

- `user_security: object { source_ip_rule, created_at, updated_at }`

  User security settings response.

  - `source_ip_rule: object { allowed, blocked }`

    IP filter rules.

    - `allowed: array of string`

      List of IPv4 CIDR addresses to allow.

    - `blocked: array of string`

      List of IPv4 CIDR addresses to deny.

  - `created_at: optional string`

    When the user security settings were created.

  - `updated_at: optional string`

    When the user security settings were updated.

### Example

```cli
nirvana user:security update \
  --api-key 'My API Key'
```

#### Response

```json
{
  "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"
}
```

## Domain Types

### User Security

- `user_security: object { source_ip_rule, created_at, updated_at }`

  User security settings response.

  - `source_ip_rule: object { allowed, blocked }`

    IP filter rules.

    - `allowed: array of string`

      List of IPv4 CIDR addresses to allow.

    - `blocked: array of string`

      List of IPv4 CIDR addresses to deny.

  - `created_at: optional string`

    When the user security settings were created.

  - `updated_at: optional string`

    When the user security settings were updated.
