Skip to Content
Web API: The Good Parts
book

Web API: The Good Parts

by 水野 貴明
November 2014
Intermediate to advanced
224 pages
3h 22m
Japanese
O'Reilly Japan, Inc.
Content preview from Web API: The Good Parts

6章堅牢なWeb APIを作る

Web APIは通常のウェブアプリケーションと同様にHTTPを通じて公開されるサービスですから、同様に安定性やセキュリティが要求されます。そしてそれに加えて、ウェブアプリケーションと異なり、機械的なアクセスを受け入れることを前提としているため、通常のウェブアプリケーションとは異なる対策も必要となります。本章では「安全性」と「安定性」の2つの面から、堅牢なWeb APIを作るための方法を考えていきます。

6.1 Web APIを安全にする

Web APIは今やいたるところで使われており、その中にはあたり前ですが外部に知られたくない個人情報や機密情報、あるいはサービス提供側の想定しないやり方でデータの操作をされたくない、といったケースは数多くあります。というよりも、よっぽど一般的な情報を提供している、たとえば天気情報やジオコーディングなどの情報をただ提供するAPIでなければ、情報の公開先や操作できるユーザーなどをコントロールしなければならないことがほとんどのはずです。そこでユーザー認証を使ってアクセスしてきているユーザーを特定したりするわけですが、それだけではサービス提供側が「意図しない」操作や攻撃が行われてしまうかもしれません。インターネットでアクセス可能なWeb APIにおいては、たとえば悪意のある第三者による攻撃や情報の漏洩を防ぐ、認証されたユーザーによる不正な操作を防ぐなど、さまざまな防衛策を考えておく必要があります。

もちろんWeb APIだけでなく、何らかのコンピュータをインターネット上でアクセス可能な場所に設置すれば、攻撃が行われる可能性は必ずありますし、APIではない通常のウェブサイトであっても常に攻撃の危険にさらされています。そしてさらにそれに加えてAPIはそもそもがプログラムでアクセスするものであるがゆえに機械的にアクセスしやすいため、通常のウェブサイトとはまた違った対策も必要となってきます。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Principles of Web API Design: Delivering Value with APIs and Microservices

Principles of Web API Design: Delivering Value with APIs and Microservices

James Higginbotham
API Design Patterns

API Design Patterns

John J. Geewax
Designing APIs with Swagger and OpenAPI

Designing APIs with Swagger and OpenAPI

Lukas Rosenstock, Joshua Ponelat
Mastering API Architecture

Mastering API Architecture

James Gough, Daniel Bryant, Matthew Auburn

Publisher Resources

ISBN: 9784873116860Other