Skip to content

Conversation

@AmaseCocoa
Copy link
Member

RFC9421準拠の署名実装を追加します。

Add RFC9421 compliant signature implementation.

これは#12 を解決します

@AmaseCocoa AmaseCocoa self-assigned this Jun 20, 2025
@AmaseCocoa AmaseCocoa added the enhancement New feature or request label Jun 20, 2025
@github-actions
Copy link

Lint Result

Not fixable checks
src/apsig/rfc9421.py:6:42: F401 [*] `cryptography.hazmat.backends.default_backend` imported but unused
  |
4 | from pprint import pprint
5 |
6 | from cryptography.hazmat.backends import default_backend
  |                                          ^^^^^^^^^^^^^^^ F401
7 | from cryptography.hazmat.primitives.asymmetric import ed25519
8 | from cryptography.hazmat.primitives import serialization
  |
  = help: Remove unused import: `cryptography.hazmat.backends.default_backend`

src/apsig/rfc9421.py:8:44: F401 [*] `cryptography.hazmat.primitives.serialization` imported but unused
   |
 6 | from cryptography.hazmat.backends import default_backend
 7 | from cryptography.hazmat.primitives.asymmetric import ed25519
 8 | from cryptography.hazmat.primitives import serialization
   |                                            ^^^^^^^^^^^^^ F401
 9 |
10 | from apsig.draft.tools import calculate_digest
   |
   = help: Remove unused import: `cryptography.hazmat.primitives.serialization`

Found 2 errors.
[*] 2 fixable with the `--fix` option.

@AmaseCocoa AmaseCocoa linked an issue Jun 20, 2025 that may be closed by this pull request
@github-actions
Copy link

Lint Result

Not fixable checks
src/apsig/rfc9421.py:6:42: F401 [*] `cryptography.hazmat.backends.default_backend` imported but unused
  |
4 | from pprint import pprint
5 |
6 | from cryptography.hazmat.backends import default_backend
  |                                          ^^^^^^^^^^^^^^^ F401
7 | from cryptography.hazmat.primitives.asymmetric import ed25519
8 | from cryptography.hazmat.primitives import serialization
  |
  = help: Remove unused import: `cryptography.hazmat.backends.default_backend`

src/apsig/rfc9421.py:8:44: F401 [*] `cryptography.hazmat.primitives.serialization` imported but unused
   |
 6 | from cryptography.hazmat.backends import default_backend
 7 | from cryptography.hazmat.primitives.asymmetric import ed25519
 8 | from cryptography.hazmat.primitives import serialization
   |                                            ^^^^^^^^^^^^^ F401
 9 |
10 | from apsig.draft.tools import calculate_digest
   |
   = help: Remove unused import: `cryptography.hazmat.primitives.serialization`

Found 2 errors.
[*] 2 fixable with the `--fix` option.

@AmaseCocoa
Copy link
Member Author

AmaseCocoa commented Jul 31, 2025

Todo

  • Fedifyで何故かActorから鍵が読み込まれない
    • 生成部分は8b32のテストサーバーと共通なのでRFCの実装側に問題がある可能性あり
  • 署名の検証

@github-actions
Copy link

Lint Result

Not fixable checks
src/apsig/rfc9421.py:6:42: F401 [*] `cryptography.hazmat.backends.default_backend` imported but unused
  |
4 | from pprint import pprint
5 |
6 | from cryptography.hazmat.backends import default_backend
  |                                          ^^^^^^^^^^^^^^^ F401
7 | from cryptography.hazmat.primitives.asymmetric import ed25519
8 | from cryptography.hazmat.primitives import serialization
  |
  = help: Remove unused import: `cryptography.hazmat.backends.default_backend`

src/apsig/rfc9421.py:8:44: F401 [*] `cryptography.hazmat.primitives.serialization` imported but unused
   |
 6 | from cryptography.hazmat.backends import default_backend
 7 | from cryptography.hazmat.primitives.asymmetric import ed25519
 8 | from cryptography.hazmat.primitives import serialization
   |                                            ^^^^^^^^^^^^^ F401
 9 |
10 | from apsig.draft.tools import calculate_digest
   |
   = help: Remove unused import: `cryptography.hazmat.primitives.serialization`

Found 2 errors.
[*] 2 fixable with the `--fix` option.

@github-actions
Copy link

Lint Result

Not fixable checks
F401 [*] `pyfill.datetime.utcnow` imported but unused
  --> src/apsig/rfc9421.py:17:29
   |
15 | )
16 | from multiformats import multibase, multicodec
17 | from pyfill.datetime import utcnow
   |                             ^^^^^^
18 |
19 | from apsig.draft.tools import calculate_digest
   |
help: Remove unused import: `pyfill.datetime.utcnow`

F841 Local variable `gmt_time` is assigned to but never used
   --> src/apsig/rfc9421.py:197:9
    |
195 |             raise ValueError("Unknown created value")
196 |         gmt_tz = pytz.timezone("GMT")
197 |         gmt_time = gmt_tz.localize(created_timestamp)
    |         ^^^^^^^^
198 |         request_time = created_timestamp.astimezone(pytz.utc)
199 |         current_time = dt.datetime.now(dt.UTC)
    |
help: Remove assignment to unused variable `gmt_time`

Found 2 errors.
[*] 1 fixable with the `--fix` option (1 hidden fix can be enabled with the `--unsafe-fixes` option).

@github-actions
Copy link

Lint Result

Not fixable checks
F841 Local variable `gmt_tz` is assigned to but never used
   --> src/apsig/rfc9421.py:194:9
    |
192 |         else:
193 |             raise ValueError("Unknown created value")
194 |         gmt_tz = pytz.timezone("GMT")
    |         ^^^^^^
195 |         request_time = created_timestamp.astimezone(pytz.utc)
196 |         current_time = dt.datetime.now(dt.UTC)
    |
help: Remove assignment to unused variable `gmt_tz`

Found 1 error.
No fixes available (1 hidden fix can be enabled with the `--unsafe-fixes` option).

@github-actions
Copy link

Lint Result

Not fixable checks
All checks passed!

@AmaseCocoa AmaseCocoa mentioned this pull request Oct 21, 2025
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implementing RFC 9421

1 participant