承接 queueit/queuetoken-v1-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

queueit/queuetoken-v1-php

Composer 安装命令:

composer require queueit/queuetoken-v1-php

包简介

Queue-it PHP queue token library for managing enqueue tokens

README 文档

README

The Queue-it Queue Token SDK is used to ensure that end users cannot enter the queue without a valid token and to be a container which can carry sensitive user information from integrating system into the queue.

The Token

The token consists of two parts. Firstly, a header containing non-sensitive metadata. Secondly the payload of the token. Both header and payload are in JSON format.

Token Header

{
  "typ": "QT1",
  "enc": "AES256",
  "iss": 1526464517,
  "exp": 1526524517,
  "ti": "159aba3e-55e1-4f54-b6ee-e5b943d7e885",
  "c": "ticketania",
  "e": "demoevent",
  "ip": "75.86.129.4",
  "xff": "45.67.2.4,34.56.3.2"
}
  • typ: The type of the token. Value must be "QT1". Required.
  • enc: Payload encryption algorithm. Value must be "AES256". Required.
  • iss: NumericDate of when token was issued. Required.
  • exp: NumericDate of when token expires. Optional.
  • ti: Unique Token ID (e.g. uuid). Used to uniquely identify tokens and restrict replay attacks. Required.
  • c: The Customer ID of the issuer. Token will only be valid on events on this account. Required.
  • e: The Event ID. If provided, token will only be valid on this event. Optional.
  • ip: The IP address of user the token is issued for. If provided, the IP address in the token is validated against the client IP before issuing a new Queue id. Optional.
  • xff: The X-Forwarded-For header of the request when the token is issued. Only used for logging. Optional.

Token Payload

{
  "r": 0.4578,
  "k": "XKDI42W",
  "cd": { "size": "medium" },
  "o": ""
}
  • r: The relative quality of the key. Must be a decimal value. Used for determining the quality of the token. Optional
  • k: A unique key that holds value to the integrating system (e.g. email or user id). Used to restrict users from issuing multiple queue ids. Optional.
  • cd: Any custom data of the user. This is a set of key-value pairs. Optional
  • o: Origin. A string representing he origin who is using this EnqueueToken. Optional

Usage

const secretKey = '...';
const token = Token
    .enqueue("ticketania")
    .withPayload(Payload
        .enqueue()
        .withKey("XKDI42W")
        .withRelativeQuality(0.4578)
        .withCustomData("size", "medium")
        .generate())
    .withEventId("demoevent")
    .withIpAddress("75.86.129.4", "45.67.2.4,34.56.3.2")
    .withValidity(60000)
    .generate(secretKey);

const tokenValue = token.Token;

Specifying token identifier prefix

A prefix for the token identifier can optionally be provided to restrict the user session after getting through the queue to the one used before entering the queue. Once the user is through the queue the token identifier is provided to the target application in the Known User token. The format of the token identifier is then [YOUR PREFIX]~[GUID], e.g: AnfTDnpwazllYmnmgaCJ8tErV80YHv77ni5NgqQNhfWwxNqrNcHb~e937ef0d-48ec-4ff7-866e-52033273cb3d.

const tokenIdentifierPrefix = "AnfTDnpwazllYmnmgaCJ8tErV80YHv77ni5NgqQNhfWwxNqrNcHb";
const token = Token
    .enqueue("ticketania", tokenIdentifierPrefix)
    .generate(secretKey);

const tokenIdentifier = token.TokenIdentifier;
// tokenIdentifier example: AnfTDnpwazllYmnmgaCJ8tErV80YHv77ni5NgqQNhfWwxNqrNcHb~e937ef0d-48ec-4ff7-866e-52033273cb3d

Serialized Token

eyJ0eXAiOiJRVDEiLCJlbmMiOiJBRVMyNTYiLCJpc3MiOjE1MzQ3MjMyMDAwMDAsImV4cCI6MTUzOTEyOTYwMDAwMCwidGkiOiJhMjFkNDIzYS00M2ZkLTQ4MjEtODRmYS00MzkwZjZhMmZkM2UiLCJjIjoidGlja2V0YW5pYSIsImUiOiJteWV2ZW50In0.0rDlI69F1Dx4Twps5qD4cQrbXbCRiezBd6fH1PVm6CnVY456FALkAhN3rgVrh_PGCJHcEXN5zoqFg65MH8WZc_CQdD63hJre3Sedu0-9zIs.aZgzkJm57etFaXjjME_-9LjOgPNTTqkp1aJ057HuEiU

The format of the token is [header].[payload].[hash] where each part is Base64Url encoded. The payload is AES 256 encrypted with the secret key supplied in the .Generate(secretKey) method. If the "e" key is provided in the header, the secret key on the event must be used. If no "e" key is provided the default key on the customer account must be used. The token is signed with SHA 256 using the same secret key.

queueit/queuetoken-v1-php 适用场景与选型建议

queueit/queuetoken-v1-php 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.45k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 01 月 06 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「queue」 「queueit」 「queue-token」 「enqueue-token」 「traffic-management」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 queueit/queuetoken-v1-php 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 queueit/queuetoken-v1-php 我们能提供哪些服务?
定制开发 / 二次开发

基于 queueit/queuetoken-v1-php 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 1.45k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 7
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2026-01-06