跳到主要内容
Sursa Developers

对象

ApiKeyUpdate

对密钥的更改。未传入的字段保持不变,data_profile 为可选。空的 scopes 列表表示按角色确定权限范围,空的 collection_ids 和 allowed_cidrs 表示不限制,expires_at 设为 null 表示密钥永不过期。本身仅限部分合集的密钥不能取消或放宽合集限制(collection_ids)。

字段

  • data_profilestring

    密钥的新数据权限档案。数据权限档案不适用于 admin 角色,因此为管理员密钥指定 full 以外的档案会返回 400 api_keys.data_profile_not_applicable。

  • scopesarray of ApiKeyScope

    密钥的权限范围。权限范围 system 不能通过 API 签发。

  • collection_idsarray of integer

    将密钥限制在这些合集中。空列表表示不限制。本身仅限部分合集的调用密钥只能看到和更改位于其合集中的密钥(其他密钥返回 404 api_keys.not_found),并且只能设置由其自身合集组成的非空列表。传入空列表或不在其列表中的合集时,返回 400 api_keys.invalid_collections。不传该字段时,密钥的合集保持不变。

    items ≤ 100

  • allowed_cidrsarray of string

    可使用该密钥的网络。

    items ≤ 50

  • expires_atstring (date-time) | null

    过期时间(须为将来的时间)。null 表示密钥永不过期。

使用方