Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

SubtleCrypto#importKey should accept `readonly KeyUsage[]`

オープン
#1,929 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
typescript
領域
tooling

調査の方向性

まず、生成された SubtleCrypto の宣言と、importKey、deriveKey、generateKey、unwrapKey のジェネレーター入力またはエントリーポイントを見つけます。各オーバーロードの keyUsages パラメーターを Web Cryptography API のリファレンスと比較し、影響を受けるすべてのオーバーロードが readonly の KeyUsage 配列を受け入れることを確認して、利用可能であれば関連する生成テストまたは型テストを実行します。

索引モデルが issue の本文から書いたものです。

説明

As of @types/[email protected], SubtleCrypto is declared as:

interface SubtleCrypto {
    importKey(format: "jwk", keyData: JsonWebKey, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKey>;
    importKey(format: Exclude<KeyFormat, "jwk">, keyData: BufferSource, algorithm: AlgorithmIdentifier | RsaHashedImportParams | EcKeyImportParams | HmacImportParams | AesKeyAlgorithm, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
}

Notably, the keyUsages argument in the first overload accepts readonly KeyUsage[], while the second overload requires a mutable array.

Web Cryptography API section 14.3.9 does not have any procedure that would mutate this argument.
Hence, this argument should accept readonly in both overloads.

The same problem also occurs in one of the overloads in deriveKey and generateKey and unwrapKey methods.

主要言語
TypeScript
スター
740
フォーク
474
平均マージ
3日 7時間
マージ済み PR(30日)
14

環境構築

このプロジェクトの環境構築ファイルはまだ確認していません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/TypeScript-DOM-lib-generator のほかの issue

microsoft/TypeScript-DOM-lib-generator の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。