Table of Contents

Class TokenPolicy

Namespace
Cloudflare.NET.ApiTokens.Models
Assembly
Cloudflare.NET.dll

A token policy defining allowed or denied permissions and resources.

Each policy specifies an effect (allow or deny), the permission groups that define what actions are permitted, and the resources the policy applies to.

public record TokenPolicy : IEquatable<TokenPolicy>
Inheritance
TokenPolicy
Implements
Inherited Members

Constructors

TokenPolicy(string?, string, IReadOnlyList<TokenPermissionGroupReference>, IReadOnlyDictionary<string, string>)

A token policy defining allowed or denied permissions and resources.

Each policy specifies an effect (allow or deny), the permission groups that define what actions are permitted, and the resources the policy applies to.

public TokenPolicy(string? Id, string Effect, IReadOnlyList<TokenPermissionGroupReference> PermissionGroups, IReadOnlyDictionary<string, string> Resources)

Parameters

Id string

Policy identifier. May be null for new policies.

Effect string

Policy effect: "allow" or "deny".

PermissionGroups IReadOnlyList<TokenPermissionGroupReference>

Permission groups granted by this policy.

Resources IReadOnlyDictionary<string, string>

Resources this policy applies to. Keys are resource types, values are resource identifiers or wildcards.

Properties

Effect

Policy effect: "allow" or "deny".

[JsonPropertyName("effect")]
public string Effect { get; init; }

Property Value

string

Id

Policy identifier. May be null for new policies.

[JsonPropertyName("id")]
public string? Id { get; init; }

Property Value

string

PermissionGroups

Permission groups granted by this policy.

[JsonPropertyName("permission_groups")]
public IReadOnlyList<TokenPermissionGroupReference> PermissionGroups { get; init; }

Property Value

IReadOnlyList<TokenPermissionGroupReference>

Resources

Resources this policy applies to. Keys are resource types, values are resource identifiers or wildcards.

[JsonPropertyName("resources")]
public IReadOnlyDictionary<string, string> Resources { get; init; }

Property Value

IReadOnlyDictionary<string, string>