Skip to content

Commit 68df43f

Browse files
committed
chore: release 1.1.0
1 parent a3da19d commit 68df43f

File tree

7 files changed

+245
-142
lines changed

7 files changed

+245
-142
lines changed

docs/changelog.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@ Changelog
1212
.. module:: joserfc
1313
:noindex:
1414

15-
Unreleased
16-
----------
15+
1.1.0
16+
-----
17+
18+
**Released on May 24, 2025**
1719

1820
- Use "import as" to prioritize the modules for editors.
1921
- Added parameter ``encoder_cls`` for ``jwt.encode`` and ``decoder_cls`` for ``jwt.decode``.
2022
- Added ``none`` algorithm for JWS.
23+
- Added ``jwk.import_key`` and ``jwk.generate_key`` aliases.
2124

2225
**Breaking changes**:
2326

docs/guide/jwk.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,14 @@ the key type manually:
398398
data = b"---- BEGIN RSA PRIVATE KEY ----\n..."
399399
key = JWKRegistry.import_key(data, "RSA")
400400
401+
.. versionadded:: v1.1.0
402+
403+
You can use ``jwk.import_key`` directly. For example::
404+
405+
from joserfc.jwk import import_key
406+
data = {"kty": "oct", "k": "..."}
407+
key = import_key(data)
408+
401409
Generate keys
402410
~~~~~~~~~~~~~
403411

@@ -419,6 +427,13 @@ For ``EC`` and ``OKP`` keys, the parameters are:
419427
key = JWKRegistry.generate_key("EC", "P-256")
420428
key = JWKRegistry.generate_key("OKP", "Ed25519")
421429
430+
.. versionadded:: v1.1.0
431+
432+
You can use ``jwk.generate_key`` directly. For example::
433+
434+
from joserfc.jwk import generate_key
435+
key = generate_key("oct", 256)
436+
422437
Options
423438
-------
424439

docs/locales/zh/LC_MESSAGES/api.po

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: joserfc\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2025-04-20 18:35+0900\n"
11+
"POT-Creation-Date: 2025-05-24 13:25+0900\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language: zh\n"
@@ -500,19 +500,19 @@ msgstr ""
500500
"从字节、字符串和字典导入密钥的类方法。当 ``value`` 为字典时,此方法可以自动识别密钥类型,否则,开发人员应自行传递 "
501501
"``key_type``。"
502502

503-
#: joserfc._keys.JWKRegistry.import_key:5 of
503+
#: joserfc._keys.JWKRegistry.import_key:5 joserfc.jwk.import_key:5 of
504504
msgid "the key data in bytes, string, or dict."
505505
msgstr "字节、字符串或字典形式的密钥数据。"
506506

507-
#: joserfc._keys.JWKRegistry.import_key:6 of
507+
#: joserfc._keys.JWKRegistry.import_key:6 joserfc.jwk.import_key:6 of
508508
msgid "an optional key type in string."
509509
msgstr "可选的密钥类型字符串。"
510510

511-
#: joserfc._keys.JWKRegistry.import_key:7 of
511+
#: joserfc._keys.JWKRegistry.import_key:7 joserfc.jwk.import_key:7 of
512512
msgid "extra key parameters"
513513
msgstr "额外的密钥参数"
514514

515-
#: joserfc._keys.JWKRegistry.import_key:8 of
515+
#: joserfc._keys.JWKRegistry.import_key:8 joserfc.jwk.import_key:8 of
516516
msgid "OctKey, RSAKey, ECKey, or OKPKey"
517517
msgstr "OctKey、RSAKey、ECKey 或 OKPKey"
518518

@@ -565,6 +565,17 @@ msgid ""
565565
"editor.org/rfc/rfc7518#section-6.3"
566566
msgstr "RSA 密钥注册表定义 https://www.rfc-editor.org/rfc/rfc7518#section-6.3"
567567

568+
#: joserfc.jwk.generate_key:1 of
569+
#, fuzzy
570+
msgid ""
571+
"Generating key according to the given key type. When ``key_type`` is "
572+
"\"oct\" and \"RSA\", the second parameter SHOULD be a key size in bits. "
573+
"When ``key_type`` is \"EC\" and \"OKP\", the second parameter SHOULD be a"
574+
" \"crv\" string."
575+
msgstr ""
576+
"根据给定的密钥类型生成密钥的类方法。当 ``key_type`` 为 \"oct\"\"RSA\" 时,第二个参数应为位大小。当 "
577+
"``key_type`` 为 \"EC\"\"OKP\" 时,第二个参数应为 \"crv\" 字符串。"
578+
568579
#: joserfc.jwk.guess_key:1 of
569580
msgid "Guess key from a various sources."
570581
msgstr "从各种来源猜测密钥。"
@@ -581,6 +592,16 @@ msgstr "具有 ``headers`` 和 ``set_kid`` 方法的协议"
581592
msgid "pick a random key from key set"
582593
msgstr "从密钥集中随机选择一个密钥"
583594

595+
#: joserfc.jwk.import_key:1 of
596+
#, fuzzy
597+
msgid ""
598+
"Importing a key from bytes, string, and dict. When ``value`` is a dict, "
599+
"this method can tell the key type automatically, otherwise, developers "
600+
"SHOULD pass the ``key_type`` themselves."
601+
msgstr ""
602+
"从字节、字符串和字典导入密钥的类方法。当 ``value`` 为字典时,此方法可以自动识别密钥类型,否则,开发人员应自行传递 "
603+
"``key_type``。"
604+
584605
#: ../../api/jws.rst:6
585606
msgid ""
586607
"This part of the documentation covers all the interfaces of "

0 commit comments

Comments
 (0)