Webhook
webhook(ウェブフック)は、web開発でカスタムのコールバックを用いてウェブページやウェブアプリケーションの動作を…
webhook(ウェブフック)は、web開発でカスタムのコールバックを用いてウェブページやウェブアプリケーションの動作を追加または変更するための方法である。このコールバックは、元のウェブサイトやアプリケーションはサードパーティーのユーザーや開発者がメンテナンス、修正、管理できる場合がある。「webhook」という用語は、コンピュータプログラミングの用語hookから、2007年にJeff Lindsayによって作られた[1]。
フォーマットには、通常JSONが利用される。リクエストは、HTTP POSTリクエストとして行われる。
関数
webhookは「ユーザー定義のHTTPコールバック」である[2]。通常、コードをリポジトリにプッシュしたときや[3]、コメントがブログに投稿されたときなどのイベントによってトリガーされる[4]。イベントが発生すると、ソースサイトはwebhook用に設定されたURLにHTTPリクエストを送信する。ユーザーは、あるサイトのイベントによって、別のサイトの動作を呼び出すように設定できる。
一般的な用途には、継続的インテグレーションシステムでビルドをトリガーする[5]、バグトラッキングシステムに通知するなどがある。webhookはHTTPを使用するため、新しいインフラストラクチャを追加せずにWebサービスに統合することができる[6]。
webhook通知の認証
クライアント(発信元のWebサイトまたはアプリケーション)がサードパーティーユーザーのサーバにwebhook呼び出しを行う場合、スプーフィング攻撃を回避するために、受信したPOSTリクエストを認証する必要がある。クライアントを認証するためには、次にようなさまざまな手法がある。
- 受信エンドポイントが、要求を許可する既知のソースのIPアドレスのリストを保持する。
- HTTPのBasic認証を使用して、クライアントを認証する[7]。
- Webhookに、イベントの種類に関する情報、Webhookを検証するためのシークレットまたは署名を含める。
- HMAC署名をHTTPヘッダーに含める。 GitHubとStripe[8]はこの方法を利用している。
- SHA-1を使用してリクエストに署名する[9]。Facebookはこの方法を利用している。
- 接続が確立されたときにMutual TLS認証を使用する。エンドポイント(サーバ)はクライアントの証明書を検証できる[10]。
関連項目
出典
- ^ Web hook to revolutionize the web, (3 May 2007), オリジナルの2018-06-30時点におけるアーカイブ。
- ^ “Webhooks”. Atlassian. 2019年9月24日閲覧。]
- ^ About Webhooks - Github Help
- ^ WordPress Webhooks
- ^ Jenkins GitHub Commit Hooks HOWTO, オリジナルの2015-09-25時点におけるアーカイブ。
- ^ What are WebHooks and How Do They Enable a Real-time Web?
- ^ “DocuSign Connect Now Includes Basic Authentication Support”. DocuSign. DocuSign, Inc.. 2020年1月15日閲覧。 “the Connect notification service has been updated to support the Basic Authentication scheme with customers’ Connect servers (listeners).”
- ^ “Checking Webhook Signatures”. Stripe. Stripe, Inc. 2019年5月12日閲覧。
- ^ “Getting Started - Graph API - Documentation - Facebook for Developers”. Facebook. Facebook, Inc.. 2019年5月12日閲覧。
- ^ “Mutual TLS: Stuff you should know”. DocuSign. DocuSign, Inc.. 2020年1月15日閲覧。 “Mutual TLS plus Client Access Control enables your listener app to ensure that the Connect notification message was sent by DocuSign and that it wasn’t modified en route.”
外部リンク
Content Disclaimer
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.
- The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
- There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
- It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
- Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
- Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.