V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
bigbyto
V2EX  ›  程序员

JWT Claims 该如何翻译

  •  
  •   bigbyto ·
    xingty · 2021-01-23 22:51:41 +08:00 · 3005 次点击
    这是一个创建于 1187 天前的主题,其中的信息可能已经有所发展或是发生改变。

    看 RFC 中对它的描述似乎是等价于 JSON 中的"字段",那该怎么翻译 JWT Claims 比较好呢?或者说为什么要取名为 Claims,希望大佬不吝赐教。

    The JWT Claims Set represents a JSON object whose members are the claims conveyed by the JWT. The Claim Names within a JWT Claims Set MUST be unique; JWT parsers MUST either reject JWTs with duplicate Claim Names or use a JSON parser that returns only the lexically last duplicate member name, as specified in Section 15.12 ("The JSON Object") of ECMAScript 5.1 [ECMAScript].

    The claims in a JWT are encoded as a JSON object that is used as the payload of a JSON Web Signature (JWS) structure

    第 1 条附言  ·  2021-01-23 23:25:00 +08:00
    找到了,这是个比较专业的描述。大概可理解为"对认证主体(或者说 subject)的一种叙述"

    A claim is a statement that one subject, such as a person or organization, makes about itself or another subject. For example, the statement can be about a name, group, buying preference, ethnicity, privilege, association or capability. The subject making the claim or claims is the provider. Claims are packaged into one or more tokens that are then issued by an issuer (provider), commonly known as a security token service (STS).[2]

    详见维基百科: https://en.wikipedia.org/wiki/Claims-based_identity
    12 条回复    2021-01-25 09:50:23 +08:00
    catror
        1
    catror  
       2021-01-23 23:16:52 +08:00 via Android
    就翻译成字段呗,claims 这个词带点“可信”的意思,相对比较正式。
    bigbyto
        2
    bigbyto  
    OP
       2021-01-23 23:27:35 +08:00
    @catror 我找了一下,Claims 是某个领域的专业术语,详情可以参考维基百科。https://en.wikipedia.org/wiki/Claims-based_identity
    u20024804
        3
    u20024804  
       2021-01-23 23:34:17 +08:00
    杰打布棣 克来姆斯
    ditel
        4
    ditel  
       2021-01-24 01:53:32 +08:00 via Android
    载荷
    好像是这个说法
    chihiro2014
        5
    chihiro2014  
       2021-01-24 10:08:53 +08:00
    @ditel 载荷是 payload
    minsheng
        6
    minsheng  
       2021-01-24 10:11:56 +08:00 via iPhone
    声明?
    minsheng
        7
    minsheng  
       2021-01-24 10:13:32 +08:00 via iPhone
    这里 claim 就是(中学时学的)英文原意,作为名词还真不知道怎么翻译
    whevether
        8
    whevether  
       2021-01-24 10:53:20 +08:00
    @chihiro2014 就是叫载荷,你 claim 中的信息就在 payload 载荷中。你前端 abot('你的 jwt'.split('.')[1]) 中的 payload 部分你看看里面的信息就是你写入到 claim 中的。
    bigbyto
        9
    bigbyto  
    OP
       2021-01-24 15:23:20 +08:00
    @whevether 是两个概念。可以说 claims 是 JWS 结构的 payload,它本身是有自己的含义的。
    bigbyto
        10
    bigbyto  
    OP
       2021-01-24 15:30:18 +08:00
    @minsheng 可以参考一下我 append 的内容,这个单词跟 handle 和 socket 这些一样,最好就是不要翻译。
    billccn
        11
    billccn  
       2021-01-25 00:19:49 +08:00
    克雷姆斯 参考鲁棒性
    wjswxp
        12
    wjswxp  
       2021-01-25 09:50:23 +08:00 via iPhone
    宣称?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5765 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 02:32 · PVG 10:32 · LAX 19:32 · JFK 22:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.