api services: building state-of-the-art apis

24
API Services: Building State-of- the-Art APIs Chris von See Product Management [email protected]

Upload: apigee

Post on 28-Jan-2015

114 views

Category:

Technology


1 download

DESCRIPTION

Discover how to build APIs using the Apigee API Services toolkit. Deep dive into Apigee's API Serives solution, API design and management technology including OAuth and security, persistence & caching, Node.js and more.

TRANSCRIPT

Page 1: API Services: Building State-of-the-Art APIs

API Services: Building State-of-the-Art APIsChris von See

Product Management

[email protected]

Page 2: API Services: Building State-of-the-Art APIs

2©2013 Apigee Corp. All Rights Reserved.

Four key topics . . .

1. Implementing optimal client-side API security

2. Configuring proxy runtime characteristics

3. Scripting capabilities in Apigee Edge (and how they just got better!)

4. The API Services datastore

Page 3: API Services: Building State-of-the-Art APIs

3©2013 Apigee Corp. All Rights Reserved.

Thinking about client-side applications…

Business to Business applications

Mobile applications from developers you trust (like yourself)✔

Mobile applications from developers you don't trust (like open API developers)

?

Web applications that need authenticated access

Page 4: API Services: Building State-of-the-Art APIs

4©2013 Apigee Corp. All Rights Reserved.

Client-side security: Authentication and Authorization

Security scenario OAuth grant type Supports scope?

Business to Business Client credentials grant (two-legged OAuth) Yes

Developers you trust Resource owner password grant Yes

Developers you don’t trust Authorization code grant (three-legged OAuth) Yes

HTML5 applications Implicit grant Yes

• OAuthV1 and OAuthV2 policies, covering all four grant types

Page 5: API Services: Building State-of-the-Art APIs

5©2013 Apigee Corp. All Rights Reserved.

Client-side security: Identity tracking

• API Key Validation, for identity-based access verification

• Why use API key based identity tracking instead of authorization and authentication?– Need registration and tracking of content/service users– No user-specific data involved– Rate limits or quota restrictions needed– Little or no risk associated with mis-appropriated keys

Page 6: API Services: Building State-of-the-Art APIs

6©2013 Apigee Corp. All Rights Reserved.

Client-side security: Threat Protection

✔Threat Consequences

Denial of Service attack Overwhelmed computing resources and inability to do business

Injection and scripting attacks Corrupted or lost data, compromised servers or user systems

XML/JSON threats Excessive resource utilization that can crash systems

• Spike Arrest policy, for protection against instantaneous bursts of traffic

• XML and JSON threat protection to keep malformed payloads out of your system

• Regular expression protection, allowing you to scan payloads for SQL, JavaScript, etc.

• IP address restrictions, imposing limits on who can access your API

Page 7: API Services: Building State-of-the-Art APIs

Demonstration: Let's build a basic secure API…

Page 8: API Services: Building State-of-the-Art APIs

8©2013 Apigee Corp. All Rights Reserved.

Four key topics . . .

1. Implementing optimal API security

2. Configuring proxy runtime characteristics

3. Scripting capabilities in Apigee Edge (and how they just got better!)

4. The API Services datastore

Page 9: API Services: Building State-of-the-Art APIs

9©2013 Apigee Corp. All Rights Reserved.

Why would you need to configure a proxy?

For use cases like this . . .

• HTTP basic authorization credentials for back-end systems

• Changing rate limits, quotas, cache expiration intervals or other service execution characteristics

• Updating application-specific configuration values

• Updating shared processing or transformation logic

Use API Services features like this . . .

• Key-value maps

• API Products

• Custom attributes on API Products, Developer or Developer Application definitions

• Change resources stored at the organization or environment level, such as:

– JavaScript or Python scripts

– Java classes, in JAR format

– WSDL files and XML Schemas

– XSLT stylesheets

Page 10: API Services: Building State-of-the-Art APIs

Demonstration: Let's configure an API…

Page 11: API Services: Building State-of-the-Art APIs

11©2013 Apigee Corp. All Rights Reserved.

Four key topics . . .

1. Implementing optimal API security

2. Configuring proxy runtime characteristics

3. Scripting capabilities in Apigee Edge (and how they just got better!)

4. The API Services datastore

✔✔

Page 12: API Services: Building State-of-the-Art APIs

12©2013 Apigee Corp. All Rights Reserved.

Scripting capabilities in API Services

In the beginning . . . Then things got better . . . And now, it's even better with

the public beta of . . .

Page 13: API Services: Building State-of-the-Art APIs

13©2013 Apigee Corp. All Rights Reserved.

What can you do with Apigee’s node.js support?

• Build highly-customized standalone APIs by leveraging Apigee’s integrated node.js as your back-end system

• Solve complex orchestration or mobile optimization problems by combining Apigee policies with the power of a scriptable target endpoint

• Use many of the thousands of third-party node.js modules in your APIs without modification

• Leverage Apigee’s world-class cloud operations

Page 14: API Services: Building State-of-the-Art APIs

14©2013 Apigee Corp. All Rights Reserved.

Getting started with node.js is easy…

Page 15: API Services: Building State-of-the-Art APIs

15©2013 Apigee Corp. All Rights Reserved.

Importing Node.js apps into Apigee

1. Download and install apigeetool . . .

$ git clone https://github.com/apigee/api-platform-tools.git

$ cd api-platform-tools$ sudo python setup.py install

$ apigeetool deploynodeapp –n hello –d . –m server.js \-o org_name –e test –u username –p password

2. Create and test your great node.js app, and deploy it to Apigee …

$ curl http://org-name-test.apigee.net/Hello, World!

3. Run it!

Page 16: API Services: Building State-of-the-Art APIs

16©2013 Apigee Corp. All Rights Reserved.

Node.js: A bit of the details…

• Modules pre-installed on the API platform:– argo 0.1.8– usergrid 0.10.5– async 0.2.9– express 3.2.6– request 2.21.0– underscore 1.4.4

• Apps can exist in Apigee at the org or environment level in addition to be included as resources in an API proxy bundle.

Page 17: API Services: Building State-of-the-Art APIs

Demonstration: Let's go take a look at a node.js proxy…

Page 18: API Services: Building State-of-the-Art APIs

18©2013 Apigee Corp. All Rights Reserved.

Four key topics . . .

1. Implementing optimal API security

2. Configuring proxy runtime characteristics

3. Scripting capabilities in API Services (and how they just got better!)

4. The API Services datastore

✔✔

Page 19: API Services: Building State-of-the-Art APIs

19©2013 Apigee Corp. All Rights Reserved.

Driving clients with data: The API Services datastore

Datastore

Location queries

Push Notifications

Connections/Social

User Data

Existing backend

Partner Services

Pre-built

API S

ervi

ces

Page 20: API Services: Building State-of-the-Art APIs

20©2013 Apigee Corp. All Rights Reserved.

Driving clients with data: The API Services datastore

• Not easily posted or extracted from

existing backend

• Trapped in a database with no API

• No system of record

(app preferences / location)

• Puts adverse load on existing

backend

• Temporal in nature

• Needs to be closer to requesting

app to reduce latency

AP

I S

ervi

ces

Page 21: API Services: Building State-of-the-Art APIs

Demonstration: Let's show the datastore in action…

Page 22: API Services: Building State-of-the-Art APIs

22©2013 Apigee Corp. All Rights Reserved.

The take-aways…

1. Implementing optimal API security easy ✔

2. Configuring proxy runtime characteristics powerful ✔

3. Scripting capabilities in API Services flexible ✔

4. The API Services datastore extensible

Page 23: API Services: Building State-of-the-Art APIs

Thank you

We would love your feedback!

Don’t forget to fill out the session’s survey – found in the session details

on the conference app

#iloveapis

Page 24: API Services: Building State-of-the-Art APIs

Questions