Table of Contents

Class AdminBetaController

Namespace
FishMMO.ControlPanel.Controllers
Assembly
FishMMO-ControlPanel.dll

Beta code administration: programs, codes, minting and revocation.

[ApiController]
[Route("api/admin/beta")]
public sealed class AdminBetaController : ControllerBase
Inheritance
AdminBetaController
Inherited Members

Remarks

Administrator only. Minting grants access to the game, so it sits at OperatorStepUp alongside revocation, and both are audited. The minted codes are returned once, in the response, and deliberately NOT written to the audit row: the audit log is read by more people than this page, and a live code in it is a live code anyone reading the log can redeem. The row records the program, count, uses and expiry.

Nothing deletes a code. Revoking one ends redemption and the access of every account that redeemed it; the code and its links stay as the record.

Constructors

AdminBetaController(IBetaCodeService, BetaOptions, AuditScope, ILogger<AdminBetaController>)

public AdminBetaController(IBetaCodeService betaCodes, BetaOptions beta, AuditScope audit, ILogger<AdminBetaController> log)

Parameters

betaCodes IBetaCodeService
beta BetaOptions
audit AuditScope
log ILogger<AdminBetaController>

Methods

Codes(string, bool, int, int)

One page of codes, newest first.

[HttpGet("codes")]
[Authorize(Policy = "Operator")]
public Task<IActionResult> Codes(string program, bool includeRevoked = true, int page = 1, int pageSize = 50)

Parameters

program string
includeRevoked bool
page int
pageSize int

Returns

Task<IActionResult>

Mint(MintRequest)

Mints a batch of codes. The codes are in this response and nowhere else a person reads.

[HttpPost("mint")]
[Authorize(Policy = "Operator.StepUp")]
[Audited("beta.mint", TargetType = "beta-program")]
public Task<IActionResult> Mint(AdminBetaController.MintRequest request)

Parameters

request AdminBetaController.MintRequest

Returns

Task<IActionResult>

Programs()

Every program with codes, and how the registration gate is configured.

[HttpGet("programs")]
[Authorize(Policy = "Operator")]
public Task<IActionResult> Programs()

Returns

Task<IActionResult>

Revoke(long, ReasonRequest)

Revokes a code, ending its redemption and the access it granted.

[HttpPost("{id:long}/revoke")]
[Authorize(Policy = "Operator.StepUp")]
[Audited("beta.revoke", TargetType = "beta-code", TargetRouteValue = "id")]
public Task<IActionResult> Revoke(long id, AdminBetaController.ReasonRequest request)

Parameters

id long
request AdminBetaController.ReasonRequest

Returns

Task<IActionResult>