Giter VIP home page Giter VIP logo

graphql-voyager's People

Contributors

aritgithub avatar bollwyvl avatar brandonbyskov avatar cjmaio avatar connormcgurn avatar fllorent0d avatar fluorescenthallucinogen avatar ivangoncharov avatar izakmarais avatar jsoref avatar kandros avatar laurencega avatar lunaticmuch avatar mac2000 avatar matystl avatar mkochendorfer avatar rayzik avatar redbass avatar romain-gilliotte avatar romanhotsiy avatar rowadz avatar ruiaraujo avatar seangransee avatar soneymathew avatar spawnia avatar stekycz avatar stephane-klein avatar steplov avatar timsuchanek avatar tuukka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

graphql-voyager's Issues

Support deep linking

It would be great to be able to link to a schema or even to a schema element, for example /[schema]/[root element]/[focus element]?schema_url=data:...

build rc7 error on Mac

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build:release' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild:release', 'build:release', 'postbuild:release' ]
5 info lifecycle [email protected]~prebuild:release: [email protected]
6 info lifecycle [email protected]~build:release: [email protected]
7 verbose lifecycle [email protected]~build:release: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~build:release: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/Users/kerr/graphql-voyager-1.0.0-rc.7/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
9 verbose lifecycle [email protected]~build:release: CWD: /Users/kerr/graphql-voyager-1.0.0-rc.7
10 silly lifecycle [email protected]~build:release: Args: [ '-c',
10 silly lifecycle   'npm run clean:release && NODE_ENV=production webpack --config build/webpack.js && rimraf dist/voyager.worker.js.map && npm run build:middleware' ]
11 silly lifecycle [email protected]~build:release: Returned: code: 2  signal: null
12 info lifecycle [email protected]~build:release: Failed to exec build:release script
13 verbose stack Error: [email protected] build:release: `npm run clean:release && NODE_ENV=production webpack --config build/webpack.js && rimraf dist/voyager.worker.js.map && npm run build:middleware`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack     at emitTwo (events.js:106:13)
13 verbose stack     at EventEmitter.emit (events.js:191:7)
13 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at emitTwo (events.js:106:13)
13 verbose stack     at ChildProcess.emit (events.js:191:7)
13 verbose stack     at maybeClose (internal/child_process.js:886:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/kerr/graphql-voyager-1.0.0-rc.7
16 verbose Darwin 16.7.0
17 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build:release"
18 verbose node v6.10.2
19 verbose npm  v5.4.2
20 error code ELIFECYCLE
21 error errno 2
22 error [email protected] build:release: `npm run clean:release && NODE_ENV=production webpack --config build/webpack.js && rimraf dist/voyager.worker.js.map && npm run build:middleware`
22 error Exit status 2
23 error Failed at the [email protected] build:release script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

Deploy to Cloud

Amazing lib, great work.

It will be super great if we can have buttons like deploy to azure, deploy to heroku, deploy to xxx

Add ability to add options to the fetch request in loadWorker

In cases where you may be behind a single sign on provider, you might need to pass additional options to the fetch request inside of loadWorker, such as:

credentials: 'same-origin'

Right now there is no way to do that other than potentially shimming fetch globally, which doesn't work for the web worker.

Import by nginx or CDN

Why can not I import from a CDN or NGINX?
```

<script src="//cdn.jsdelivr.net/react/15.4.2/react.min.js"></script>
<script src="//cdn.jsdelivr.net/react/15.4.2/react-dom.min.js"></script>
<script src="https://apis.guru/graphql-voyager/releases/v1.x/voyager.min.js" ></script>

Error:
Uncaught DOMException: Failed to construct 'Worker': Script at 'https://apis.guru/graphql-voyager/releases/v1.x/voyager.worker.js' cannot be accessed from origin 'http://localhost:3000'.

query - but how?

Hi there,

I love the tool! Very nice way of visualizing a schema. I am quite new to GraphQL and run into an issue:

Whenever I try to create some sort of introspection query and copy it into the "custom schema" field, I am presented with different errors like "TypeError: Cannot read property 'map' of undefined", "TypeError: Cannot read property 'types' of undefined" or similar. Even the official examples on http://graphql.org/learn/introspection/ cause errors.
The only "valid" result I could get working was with the query https://gist.github.com/craigbeck/b90915d49fda19d5b2b17ead14dcd6da on the github API https://developer.github.com/v4/explorer/

So in other words:
How does my introspection query have to look like or comply with to work with graphql-voyager?

Thanks up front!

Middleware does not export TypeScript declarations

Thank you for building such useful tooling for the GraphQL community! One enhancement for users of TypeScript:

The build:middleware NPM script should pass tsc --declaration so .d.ts files will be generated for library consumers.

See also: the Publishing section of the TypeScript handbook

Using as a dependency

graphql-voyager 1.0.0-rc.9

I am trying to use this amazing component in a basic create-react-app but it is stuck on 'transmitting', the schema in the left sider loads fine though.

The chrome console logs a 'Uncaught SyntaxError: Unexpected token <'.

Here is a repo that reproduces the issue: https://github.com/LarsKrogJensen/voyager-issue44

The docs state a paragraph that I don't understand:
Important: make sure to copy voyager.worker.js from node_modules/graphql-voyager/dist to the same folder as your main bundle.

Where in the demo-repo am I supposed to copy the file.

TypeError: Cannot read property 'type' of undefined

Issue

When running a custom introspection query from live demo, the UI does not allow me to proceed as the button is showing the error

TypeError: Cannot read property 'type' of undefined

Resources

The introspection query (copied from the demo page) and the result can be found at:

Middleware for Node.js frameworks

Hello everybody,

What are you thinking about the idea to add middleware for frameworks like express, koa etc in the same way as apollographql does for graphiql ?
I can take care about this.

Koa documentation error

import { koa as middleware } from 'graphql-voyager/middleware'; router.all('/voyager', voyagerMiddleware({ endpointUrl: '/graphql' }));

voyagerMiddleware does not match up with what is voyager is imported as. voyagerMiddleware should be simply middleware.

Edit coords and hide some types

Thanks for creating this, it looks great!

One feature I'd appreciate is the ability to (a) drag types around, and persist the coords and (b) hide some of the types.

My use case is that I want to use this app as a way to explore my quite complex GraphQL schema. Because it's complex, it benefits from having a human lay things out nicely.

I imagine you could store a map like the following:

{
  "PersonType": {
    x: 200,
    y: 302,
    hidden: false,
  }
}

which overrides automatic layout. Then when the schema is updated, as long as the name of the type doesn't change, things should be roughly ok (maybe).

Maybe it could be possible to hide some edges too.

Do you have any such plans?

"Change introspection" button missing on npm version.

Hey, probably a lame question. I've installed raphql-voyager via npm, but I don't see the "Change introspection" button. I see only graph for Query, but can't switch to Mutation view, which is what I thought the button is for. I could probably change it using displayOptions.rootType, but that would mean exposing two instances of voyager to see both Query and Mutation, right..?

How to use the pre-bundled version

I don't know exactly how to use the prebundled version, I tried the following so far

<!DOCTYPE html>
<html>
  <head>
    <script src="//cdn.jsdelivr.net/react/15.4.2/react.min.js"></script>
    <script src="//cdn.jsdelivr.net/react/15.4.2/react-dom.min.js"></script>

    <link rel="stylesheet" href="./node_modules/graphql-voyager/dist/voyager.css" />
    <script src="./node_modules/graphql-voyager/dist/voyager.min.js"></script>
  </head>
  <body>
    <div id="voyager">Loading...</div>
    <script>
      function introspectionProvider(introspectionQuery) {
        // This example expects a GraphQL server at the path /graphql.
        // Change this to point wherever you host your GraphQL server.
        return fetch('http://127.0.0.1:8000/graphql', {
          method: 'post',
          headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json',
          },
          body: JSON.stringify({query: introspectionQuery}),
          credentials: 'include',
        }).then(function (response) {
          return response.text();
        }).then(function (responseBody) {
          try {
            return JSON.parse(responseBody);
          } catch (error) {
            return responseBody;
          }
        });
      }

      // Render <Voyager />
      GraphQLVoyager.init(document.getElementById('voyager'), {
        introspection: introspectionProvider
      })
    </script>
  </body>
</html>

What else do I need to do, if I want to use only de CDNs

Enable Data modelling

Hi this Tool looks awesome!
Do you see a chance to make it editable so that the type definitions are updated from within the voyager ?

Remove use of `eval` in worker

The worker.min.js file is being rejected by my site's Content Security Policy for use of eval.

The only workaround is to add 'unsafe-eval' to the 'script-src' directive, which is not good practice at all.

displayOptions.skipRelay not evaluated?!

Following the readme I'd assume I can set displayOptions when rendering Voyager in the body.
Based on the index.html from the sample I have the following code:

      // Render <Voyager /> into the body.
      GraphQLVoyager.init(document.getElementById('voyager'), {
          introspection: introspectionProvider,
          displayOptions: { skipRelay: false, rootType: 'HealthQuery', sortByAlphabet: true }
      });

The rendering works fine, but the skipRelay: false option is not considered (rootType and sortByAlphabet are not considered also).
Is something wrong with the init given above or is this a bug?

Wrong place for exclamation mark

In my schema I have groups: [CustomerGroup!], but Voyager display it as "groups: [CustomerGroup ]!".
The opposite case, when I set in the schema groups: [CustomerGroup]!, the Voyager shows it as "groups: [CustomerGroup !]"

"apollo-server-express": "^1.3.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-plugin-module-resolver": "^3.0.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"express": "^4.16.2",
"graphql": "^0.11.7",
"graphql-tools": "^2.13.0",
"graphql-voyager": "^1.0.0-rc.10",
app.use("/voyager", middleware({ endpointUrl: "/graphql" }));

KEL M

{
"swagger": "2.0",
"schemes": [
"http"
],
"host": "sts.amazonaws.com",
"basePath": "/",
"x-hasEquivalentPaths": true,
"info": {
"contact": {
"email": "[email protected]",
"name": "Mike Ralphson",
"url": "https://github.com/mermade/aws2openapi"
},
"description": "AWS Security Token Service

The AWS Security Token Service (STS) is a web service that enables you to request temporary, limited-privilege credentials for AWS Identity and Access Management (IAM) users or for users that you authenticate (federated users). This guide provides descriptions of the STS API. For more detailed information about using this service, go to <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html\">Temporary Security Credentials.

As an alternative to using the API, you can use one of the AWS SDKs, which consist of libraries and sample code for various programming languages and platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs provide a convenient way to create programmatic access to STS. For example, the SDKs take care of cryptographically signing requests, managing errors, and retrying requests automatically. For information about the AWS SDKs, including how to download and install them, see the <a href="http://aws.amazon.com/tools/\">Tools for Amazon Web Services page.

For information about setting up signatures and authorization through the API, go to <a href="http://docs.aws.amazon.com/general/latest/gr/signing_aws_api_requests.html\">Signing AWS API Requests in the AWS General Reference. For general information about the Query API, go to <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/IAM_UsingQueryAPI.html\">Making Query Requests in Using IAM. For information about using security tokens with other AWS products, go to <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_aws-services-that-work-with-iam.html\">AWS Services That Work with IAM in the IAM User Guide.

If you're new to AWS and need additional technical information about a specific AWS product, you can find the product's technical documentation at <a href="http://aws.amazon.com/documentation/\">http://aws.amazon.com/documentation/.

Endpoints

The AWS Security Token Service (STS) has a default endpoint of https://sts.amazonaws.com that maps to the US East (N. Virginia) region. Additional regions are available and are activated by default. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html\">Activating and Deactivating AWS STS in an AWS Region in the IAM User Guide.

For information about STS endpoints, see <a href="http://docs.aws.amazon.com/general/latest/gr/rande.html#sts_region\">Regions and Endpoints in the AWS General Reference.

Recording API requests

STS supports AWS CloudTrail, which is a service that records AWS calls for your AWS account and delivers log files to an Amazon S3 bucket. By using information collected by CloudTrail, you can determine what requests were successfully made to STS, who made the request, when it was made, and so on. To learn more about CloudTrail, including how to turn it on and find your log files, see the <a href="http://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html\">AWS CloudTrail User Guide.

",
"license": {
"name": "Apache 2.0 License",
"url": "http://www.apache.org/licenses/"
},
"termsOfService": "https://aws.amazon.com/service-terms/",
"title": "AWS Security Token Service",
"version": "2011-06-15",
"x-apiClientRegistration": {
"url": "https://portal.aws.amazon.com/gp/aws/developer/registration/index.html?nc2=h_ct"
},
"x-apisguru-categories": [
"cloud"
],
"x-logo": {
"backgroundColor": "#FFFFFF",
"url": "https://api.apis.guru/v2/cache/logo/https_media.amazonwebservices.com_blog_2007_big_pbaws_logo_300px.jpg"
},
"x-origin": [
{
"contentType": "application/json",
"converter": {
"url": "https://github.com/mermade/aws2openapi",
"version": "1.0.0"
},
"url": "https://raw.githubusercontent.com/aws/aws-sdk-js/master/apis/sts-2011-06-15.normal.json",
"x-apisguru-direct": true
}
],
"x-preferred": true,
"x-providerName": "amazonaws.com",
"x-release": "v4",
"x-serviceName": "sts"
},
"externalDocs": {
"description": "Amazon Web Services documentation",
"url": "https://aws.amazon.com/sts/"
},
"consumes": [],
"produces": [],
"securityDefinitions": {
"hmac": {
"description": "Amazon Signature authorization v4",
"in": "header",
"name": "Authorization",
"type": "apiKey",
"x-amazon-apigateway-authtype": "awsSigv4"
}
},
"security": [
{
"hmac": []
}
],
"parameters": {
"Action": {
"in": "header",
"name": "Action",
"required": true,
"type": "string"
},
"Version": {
"in": "header",
"name": "Version",
"required": true,
"type": "string"
},
"X-Amz-Algorithm": {
"in": "header",
"name": "X-Amz-Algorithm",
"required": false,
"type": "string"
},
"X-Amz-Content-Sha256": {
"in": "header",
"name": "X-Amz-Content-Sha256",
"required": false,
"type": "string"
},
"X-Amz-Credential": {
"in": "header",
"name": "X-Amz-Credential",
"required": false,
"type": "string"
},
"X-Amz-Date": {
"in": "header",
"name": "X-Amz-Date",
"required": false,
"type": "string"
},
"X-Amz-Security-Token": {
"in": "header",
"name": "X-Amz-Security-Token",
"required": false,
"type": "string"
},
"X-Amz-Signature": {
"in": "header",
"name": "X-Amz-Signature",
"required": false,
"type": "string"
},
"X-Amz-SignedHeaders": {
"in": "header",
"name": "X-Amz-SignedHeaders",
"required": false,
"type": "string"
}
},
"paths": {
"/": {
"parameters": [
{
"$ref": "#/parameters/Action"
},
{
"$ref": "#/parameters/Version"
},
{
"$ref": "#/parameters/X-Amz-Content-Sha256"
},
{
"$ref": "#/parameters/X-Amz-Date"
},
{
"$ref": "#/parameters/X-Amz-Algorithm"
},
{
"$ref": "#/parameters/X-Amz-Credential"
},
{
"$ref": "#/parameters/X-Amz-Security-Token"
},
{
"$ref": "#/parameters/X-Amz-Signature"
},
{
"$ref": "#/parameters/X-Amz-SignedHeaders"
}
],
"post": {
"description": "

Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) that you can use to access AWS resources that you might not normally have access to. Typically, you use AssumeRole for cross-account access or federation. For a comparison of AssumeRole with the other APIs that produce temporary credentials, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\">Requesting Temporary Security Credentials and <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\">Comparing the AWS STS APIs in the IAM User Guide.

Important: You cannot call AssumeRole by using AWS root account credentials; access is denied. You must use credentials for an IAM user or an IAM role to call AssumeRole.

For cross-account access, imagine that you own multiple accounts and need to access resources in each account. You could create long-term credentials in each account to access those resources. However, managing all those credentials and remembering which one can access which account can be time consuming. Instead, you can create one set of long-term credentials in one account and then use temporary security credentials to access all the other accounts by assuming roles in those accounts. For more information about roles, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-toplevel.html\">IAM Roles (Delegation and Federation) in the IAM User Guide.

For federation, you can, for example, grant single sign-on access to the AWS Management Console. If you already have an identity and authentication system in your corporate network, you don't have to recreate user identities in AWS in order to grant those user identities access to AWS. Instead, after a user has been authenticated, you call AssumeRole (and specify the role with the appropriate permissions) to get temporary security credentials for that user. With those temporary security credentials, you construct a sign-in URL that users can use to access the console. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html#sts-introduction\">Common Scenarios for Temporary Credentials in the IAM User Guide.

The temporary security credentials are valid for the duration that you specified when calling AssumeRole, which can be from 900 seconds (15 minutes) to a maximum of 3600 seconds (1 hour). The default is 1 hour.

The temporary security credentials created by AssumeRole can be used to make API calls to any AWS service with the following exception: you cannot call the STS service's GetFederationToken or GetSessionToken APIs.

Optionally, you can pass an IAM access policy to this operation. If you choose not to pass a policy, the temporary security credentials that are returned by the operation have the permissions that are defined in the access policy of the role that is being assumed. If you pass a policy to this operation, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html\">Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity in the IAM User Guide.

To assume a role, your AWS account must be trusted by the role. The trust relationship is defined in the role's trust policy when the role is created. That trust policy states which accounts are allowed to delegate access to this account's role.

The user who wants to access the role must also have permissions delegated from the role's administrator. If the user is in a different account than the role, then the user's administrator must attach a policy that allows the user to call AssumeRole on the ARN of the role in the other account. If the user is in the same account as the role, then you can either attach a policy to the user (identical to the previous different account user), or you can add the user as a principal directly in the role's trust policy

Using MFA with AssumeRole

You can optionally include multi-factor authentication (MFA) information when you call AssumeRole. This is useful for cross-account scenarios in which you want to make sure that the user who is assuming the role has been authenticated using an AWS MFA device. In that scenario, the trust policy of the role being assumed includes a condition that tests for MFA authentication; if the caller does not include valid MFA information, the request to assume the role is denied. The condition in a trust policy that tests for MFA authentication might look like the following example.

"Condition": {"Bool": {"aws:MultiFactorAuthPresent": true}}

For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/MFAProtectedAPI.html\">Configuring MFA-Protected API Access in the IAM User Guide guide.

To use MFA with AssumeRole, you pass values for the SerialNumber and TokenCode parameters. The SerialNumber value identifies the user's hardware or virtual MFA device. The TokenCode is the time-based one-time password (TOTP) that the MFA devices produces.

",
"operationId": "AssumeRole",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AssumeRoleRequest"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/AssumeRoleResponse"
}
},
"480": {
"description": "MalformedPolicyDocumentException",
"schema": {
"$ref": "#/definitions/MalformedPolicyDocumentException"
}
},
"481": {
"description": "PackedPolicyTooLargeException",
"schema": {
"$ref": "#/definitions/PackedPolicyTooLargeException"
}
},
"482": {
"description": "RegionDisabledException",
"schema": {
"$ref": "#/definitions/RegionDisabledException"
}
}
}
}
},
"/#AssumeRoleWithSAML": {
"parameters": [
{
"$ref": "#/parameters/Action"
},
{
"$ref": "#/parameters/Version"
},
{
"$ref": "#/parameters/X-Amz-Content-Sha256"
},
{
"$ref": "#/parameters/X-Amz-Date"
},
{
"$ref": "#/parameters/X-Amz-Algorithm"
},
{
"$ref": "#/parameters/X-Amz-Credential"
},
{
"$ref": "#/parameters/X-Amz-Security-Token"
},
{
"$ref": "#/parameters/X-Amz-Signature"
},
{
"$ref": "#/parameters/X-Amz-SignedHeaders"
}
],
"post": {
"description": "

Returns a set of temporary security credentials for users who have been authenticated via a SAML authentication response. This operation provides a mechanism for tying an enterprise identity store or directory to role-based AWS access without user-specific credentials or configuration. For a comparison of AssumeRoleWithSAML with the other APIs that produce temporary credentials, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\">Requesting Temporary Security Credentials and <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\">Comparing the AWS STS APIs in the IAM User Guide.

The temporary security credentials returned by this operation consist of an access key ID, a secret access key, and a security token. Applications can use these temporary security credentials to sign calls to AWS services.

The temporary security credentials are valid for the duration that you specified when calling AssumeRole, or until the time specified in the SAML authentication response's SessionNotOnOrAfter value, whichever is shorter. The duration can be from 900 seconds (15 minutes) to a maximum of 3600 seconds (1 hour). The default is 1 hour.

The temporary security credentials created by AssumeRoleWithSAML can be used to make API calls to any AWS service with the following exception: you cannot call the STS service's GetFederationToken or GetSessionToken APIs.

Optionally, you can pass an IAM access policy to this operation. If you choose not to pass a policy, the temporary security credentials that are returned by the operation have the permissions that are defined in the access policy of the role that is being assumed. If you pass a policy to this operation, the temporary security credentials that are returned by the operation have the permissions that are allowed by the intersection of both the access policy of the role that is being assumed, and the policy that you pass. This means that both policies must grant the permission for the action to be allowed. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html\">Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity in the IAM User Guide.

Before your application can call AssumeRoleWithSAML, you must configure your SAML identity provider (IdP) to issue the claims required by AWS. Additionally, you must use AWS Identity and Access Management (IAM) to create a SAML provider entity in your AWS account that represents your identity provider, and create an IAM role that specifies this SAML provider in its trust policy.

Calling AssumeRoleWithSAML does not require the use of AWS security credentials. The identity of the caller is validated by using keys in the metadata document that is uploaded for the SAML provider entity for your identity provider.

Calling AssumeRoleWithSAML can result in an entry in your AWS CloudTrail logs. The entry includes the value in the NameID element of the SAML assertion. We recommend that you use a NameIDType that is not associated with any personally identifiable information (PII). For example, you could instead use the Persistent Identifier (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent).

For more information, see the following resources:

",
"operationId": "AssumeRoleWithSAML",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AssumeRoleWithSAMLRequest"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/AssumeRoleWithSAMLResponse"
}
},
"480": {
"description": "MalformedPolicyDocumentException",
"schema": {
"$ref": "#/definitions/MalformedPolicyDocumentException"
}
},
"481": {
"description": "PackedPolicyTooLargeException",
"schema": {
"$ref": "#/definitions/PackedPolicyTooLargeException"
}
},
"482": {
"description": "IDPRejectedClaimException",
"schema": {
"$ref": "#/definitions/IDPRejectedClaimException"
}
},
"483": {
"description": "InvalidIdentityTokenException",
"schema": {
"$ref": "#/definitions/InvalidIdentityTokenException"
}
},
"484": {
"description": "ExpiredTokenException",
"schema": {
"$ref": "#/definitions/ExpiredTokenException"
}
},
"485": {
"description": "RegionDisabledException",
"schema": {
"$ref": "#/definitions/RegionDisabledException"
}
}
}
}
},
"/#AssumeRoleWithWebIdentity": {
"parameters": [
{
"$ref": "#/parameters/Action"
},
{
"$ref": "#/parameters/Version"
},
{
"$ref": "#/parameters/X-Amz-Content-Sha256"
},
{
"$ref": "#/parameters/X-Amz-Date"
},
{
"$ref": "#/parameters/X-Amz-Algorithm"
},
{
"$ref": "#/parameters/X-Amz-Credential"
},
{
"$ref": "#/parameters/X-Amz-Security-Token"
},
{
"$ref": "#/parameters/X-Amz-Signature"
},
{
"$ref": "#/parameters/X-Amz-SignedHeaders"
}
],
"post": {
"description": "

Returns a set of temporary security credentials for users who have been authenticated in a mobile or web application with a web identity provider, such as Amazon Cognito, Login with Amazon, Facebook, Google, or any OpenID Connect-compatible identity provider.

For mobile applications, we recommend that you use Amazon Cognito. You can use Amazon Cognito with the <a href="http://aws.amazon.com/sdkforios/\">AWS SDK for iOS and the <a href="http://aws.amazon.com/sdkforandroid/\">AWS SDK for Android to uniquely identify a user and supply the user with a consistent identity throughout the lifetime of an application.

To learn more about Amazon Cognito, see <a href="http://docs.aws.amazon.com/mobile/sdkforandroid/developerguide/cognito-auth.html#d0e840\">Amazon Cognito Overview in the AWS SDK for Android Developer Guide guide and <a href="http://docs.aws.amazon.com/mobile/sdkforios/developerguide/cognito-auth.html#d0e664\">Amazon Cognito Overview in the AWS SDK for iOS Developer Guide.

Calling AssumeRoleWithWebIdentity does not require the use of AWS security credentials. Therefore, you can distribute an application (for example, on mobile devices) that requests temporary security credentials without including long-term AWS credentials in the application, and without deploying server-based proxy services that use long-term AWS credentials. Instead, the identity of the caller is validated by using a token from the web identity provider. For a comparison of AssumeRoleWithWebIdentity with the other APIs that produce temporary credentials, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\">Requesting Temporary Security Credentials and <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\">Comparing the AWS STS APIs in the IAM User Guide.

The temporary security credentials returned by this API consist of an access key ID, a secret access key, and a security token. Applications can use these temporary security credentials to sign calls to AWS service APIs.

The credentials are valid for the duration that you specified when calling AssumeRoleWithWebIdentity, which can be from 900 seconds (15 minutes) to a maximum of 3600 seconds (1 hour). The default is 1 hour.

The temporary security credentials created by AssumeRoleWithWebIdentity can be used to make API calls to any AWS service with the following exception: you cannot call the STS service's GetFederationToken or GetSessionToken APIs.

Optionally, you can pass an IAM access policy to this operation. If you choose not to pass a policy, the temporary security credentials that are returned by the operation have the permissions that are defined in the access policy of the role that is being assumed. If you pass a policy to this operation, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html\">Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity in the IAM User Guide.

Before your application can call AssumeRoleWithWebIdentity, you must have an identity token from a supported identity provider and create a role that the application can assume. The role that your application assumes must trust the identity provider that is associated with the identity token. In other words, the identity provider must be specified in the role's trust policy.

Calling AssumeRoleWithWebIdentity can result in an entry in your AWS CloudTrail logs. The entry includes the <a href="http://openid.net/specs/openid-connect-core-1_0.html#Claims\">Subject of the provided Web Identity Token. We recommend that you avoid using any personally identifiable information (PII) in this field. For example, you could instead use a GUID or a pairwise identifier, as <a href="http://openid.net/specs/openid-connect-core-1_0.html#SubjectIDTypes\">suggested in the OIDC specification.

For more information about how to use web identity federation and the AssumeRoleWithWebIdentity API, see the following resources:

",
"operationId": "AssumeRoleWithWebIdentity",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/AssumeRoleWithWebIdentityRequest"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/AssumeRoleWithWebIdentityResponse"
}
},
"480": {
"description": "MalformedPolicyDocumentException",
"schema": {
"$ref": "#/definitions/MalformedPolicyDocumentException"
}
},
"481": {
"description": "PackedPolicyTooLargeException",
"schema": {
"$ref": "#/definitions/PackedPolicyTooLargeException"
}
},
"482": {
"description": "IDPRejectedClaimException",
"schema": {
"$ref": "#/definitions/IDPRejectedClaimException"
}
},
"483": {
"description": "IDPCommunicationErrorException",
"schema": {
"$ref": "#/definitions/IDPCommunicationErrorException"
}
},
"484": {
"description": "InvalidIdentityTokenException",
"schema": {
"$ref": "#/definitions/InvalidIdentityTokenException"
}
},
"485": {
"description": "ExpiredTokenException",
"schema": {
"$ref": "#/definitions/ExpiredTokenException"
}
},
"486": {
"description": "RegionDisabledException",
"schema": {
"$ref": "#/definitions/RegionDisabledException"
}
}
}
}
},
"/#DecodeAuthorizationMessage": {
"parameters": [
{
"$ref": "#/parameters/Action"
},
{
"$ref": "#/parameters/Version"
},
{
"$ref": "#/parameters/X-Amz-Content-Sha256"
},
{
"$ref": "#/parameters/X-Amz-Date"
},
{
"$ref": "#/parameters/X-Amz-Algorithm"
},
{
"$ref": "#/parameters/X-Amz-Credential"
},
{
"$ref": "#/parameters/X-Amz-Security-Token"
},
{
"$ref": "#/parameters/X-Amz-Signature"
},
{
"$ref": "#/parameters/X-Amz-SignedHeaders"
}
],
"post": {
"description": "

Decodes additional information about the authorization status of a request from an encoded message returned in response to an AWS request.

For example, if a user is not authorized to perform an action that he or she has requested, the request returns a Client.UnauthorizedOperation response (an HTTP 403 response). Some AWS actions additionally return an encoded message that can provide details about this authorization failure.

Only certain AWS actions return an encoded authorization message. The documentation for an individual action indicates whether that action returns an encoded message in addition to returning an HTTP code.

The message is encoded because the details of the authorization status can constitute privileged information that the user who requested the action should not see. To decode an authorization status message, a user must be granted permissions via an IAM policy to request the DecodeAuthorizationMessage (sts:DecodeAuthorizationMessage) action.

The decoded message includes the following type of information:

",
"operationId": "DecodeAuthorizationMessage",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/DecodeAuthorizationMessageRequest"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/DecodeAuthorizationMessageResponse"
}
},
"480": {
"description": "InvalidAuthorizationMessageException",
"schema": {
"$ref": "#/definitions/InvalidAuthorizationMessageException"
}
}
}
}
},
"/#GetCallerIdentity": {
"parameters": [
{
"$ref": "#/parameters/Action"
},
{
"$ref": "#/parameters/Version"
},
{
"$ref": "#/parameters/X-Amz-Content-Sha256"
},
{
"$ref": "#/parameters/X-Amz-Date"
},
{
"$ref": "#/parameters/X-Amz-Algorithm"
},
{
"$ref": "#/parameters/X-Amz-Credential"
},
{
"$ref": "#/parameters/X-Amz-Security-Token"
},
{
"$ref": "#/parameters/X-Amz-Signature"
},
{
"$ref": "#/parameters/X-Amz-SignedHeaders"
}
],
"post": {
"description": "Returns details about the IAM identity whose credentials are used to call the API.",
"operationId": "GetCallerIdentity",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/GetCallerIdentityRequest"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/GetCallerIdentityResponse"
}
}
}
}
},
"/#GetFederationToken": {
"parameters": [
{
"$ref": "#/parameters/Action"
},
{
"$ref": "#/parameters/Version"
},
{
"$ref": "#/parameters/X-Amz-Content-Sha256"
},
{
"$ref": "#/parameters/X-Amz-Date"
},
{
"$ref": "#/parameters/X-Amz-Algorithm"
},
{
"$ref": "#/parameters/X-Amz-Credential"
},
{
"$ref": "#/parameters/X-Amz-Security-Token"
},
{
"$ref": "#/parameters/X-Amz-Signature"
},
{
"$ref": "#/parameters/X-Amz-SignedHeaders"
}
],
"post": {
"description": "

Returns a set of temporary security credentials (consisting of an access key ID, a secret access key, and a security token) for a federated user. A typical use is in a proxy application that gets temporary security credentials on behalf of distributed applications inside a corporate network. Because you must call the GetFederationToken action using the long-term security credentials of an IAM user, this call is appropriate in contexts where those credentials can be safely stored, usually in a server-based application. For a comparison of GetFederationToken with the other APIs that produce temporary credentials, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\">Requesting Temporary Security Credentials and <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\">Comparing the AWS STS APIs in the IAM User Guide.

If you are creating a mobile-based or browser-based app that can authenticate users using a web identity provider like Login with Amazon, Facebook, Google, or an OpenID Connect-compatible identity provider, we recommend that you use <a href="http://aws.amazon.com/cognito/\">Amazon Cognito or AssumeRoleWithWebIdentity. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity\">Federation Through a Web-based Identity Provider.

The GetFederationToken action must be called by using the long-term AWS security credentials of an IAM user. You can also call GetFederationToken using the security credentials of an AWS root account, but we do not recommended it. Instead, we recommend that you create an IAM user for the purpose of the proxy application and then attach a policy to the IAM user that limits federated users to only the actions and resources that they need access to. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html\">IAM Best Practices in the IAM User Guide.

The temporary security credentials that are obtained by using the long-term credentials of an IAM user are valid for the specified duration, from 900 seconds (15 minutes) up to a maximium of 129600 seconds (36 hours). The default is 43200 seconds (12 hours). Temporary credentials that are obtained by using AWS root account credentials have a maximum duration of 3600 seconds (1 hour).

The temporary security credentials created by GetFederationToken can be used to make API calls to any AWS service with the following exceptions:

  • You cannot use these credentials to call any IAM APIs.

  • You cannot call any STS APIs except GetCallerIdentity.

Permissions

The permissions for the temporary security credentials returned by GetFederationToken are determined by a combination of the following:

  • The policy or policies that are attached to the IAM user whose credentials are used to call GetFederationToken.

  • The policy that is passed as a parameter in the call.

The passed policy is attached to the temporary security credentials that result from the GetFederationToken API call--that is, to the federated user. When the federated user makes an AWS request, AWS evaluates the policy attached to the federated user in combination with the policy or policies attached to the IAM user whose credentials were used to call GetFederationToken. AWS allows the federated user's request only when both the federated user and the IAM user are explicitly allowed to perform the requested action. The passed policy cannot grant more permissions than those that are defined in the IAM user policy.

A typical use case is that the permissions of the IAM user whose credentials are used to call GetFederationToken are designed to allow access to all the actions and resources that any federated user will need. Then, for individual users, you pass a policy to the operation that scopes down the permissions to a level that's appropriate to that individual user, using a policy that allows only a subset of permissions that are granted to the IAM user.

If you do not pass a policy, the resulting temporary security credentials have no effective permissions. The only exception is when the temporary security credentials are used to access a resource that has a resource-based policy that specifically allows the federated user to access the resource.

For more information about how permissions work, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html\">Permissions for GetFederationToken. For information about using GetFederationToken to create temporary security credentials, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken\">GetFederationToken—Federation Through a Custom Identity Broker.

",
"operationId": "GetFederationToken",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/GetFederationTokenRequest"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/GetFederationTokenResponse"
}
},
"480": {
"description": "MalformedPolicyDocumentException",
"schema": {
"$ref": "#/definitions/MalformedPolicyDocumentException"
}
},
"481": {
"description": "PackedPolicyTooLargeException",
"schema": {
"$ref": "#/definitions/PackedPolicyTooLargeException"
}
},
"482": {
"description": "RegionDisabledException",
"schema": {
"$ref": "#/definitions/RegionDisabledException"
}
}
}
}
},
"/#GetSessionToken": {
"parameters": [
{
"$ref": "#/parameters/Action"
},
{
"$ref": "#/parameters/Version"
},
{
"$ref": "#/parameters/X-Amz-Content-Sha256"
},
{
"$ref": "#/parameters/X-Amz-Date"
},
{
"$ref": "#/parameters/X-Amz-Algorithm"
},
{
"$ref": "#/parameters/X-Amz-Credential"
},
{
"$ref": "#/parameters/X-Amz-Security-Token"
},
{
"$ref": "#/parameters/X-Amz-Signature"
},
{
"$ref": "#/parameters/X-Amz-SignedHeaders"
}
],
"post": {
"description": "

Returns a set of temporary credentials for an AWS account or IAM user. The credentials consist of an access key ID, a secret access key, and a security token. Typically, you use GetSessionToken if you want to use MFA to protect programmatic calls to specific AWS APIs like Amazon EC2 StopInstances. MFA-enabled IAM users would need to call GetSessionToken and submit an MFA code that is associated with their MFA device. Using the temporary security credentials that are returned from the call, IAM users can then make programmatic calls to APIs that require MFA authentication. If you do not supply a correct MFA code, then the API returns an access denied error. For a comparison of GetSessionToken with the other APIs that produce temporary credentials, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html\">Requesting Temporary Security Credentials and <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison\">Comparing the AWS STS APIs in the IAM User Guide.

The GetSessionToken action must be called by using the long-term AWS security credentials of the AWS account or an IAM user. Credentials that are created by IAM users are valid for the duration that you specify, from 900 seconds (15 minutes) up to a maximum of 129600 seconds (36 hours), with a default of 43200 seconds (12 hours); credentials that are created by using account credentials can range from 900 seconds (15 minutes) up to a maximum of 3600 seconds (1 hour), with a default of 1 hour.

The temporary security credentials created by GetSessionToken can be used to make API calls to any AWS service with the following exceptions:

  • You cannot call any IAM APIs unless MFA authentication information is included in the request.

  • You cannot call any STS API except AssumeRole or GetCallerIdentity.

We recommend that you do not call GetSessionToken with root account credentials. Instead, follow our <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#create-iam-users\">best practices by creating one or more IAM users, giving them the necessary permissions, and using IAM users for everyday interaction with AWS.

The permissions associated with the temporary security credentials returned by GetSessionToken are based on the permissions associated with account or IAM user whose credentials are used to call the action. If GetSessionToken is called using root account credentials, the temporary credentials have root account permissions. Similarly, if GetSessionToken is called using the credentials of an IAM user, the temporary credentials have the same permissions as the IAM user.

For more information about using GetSessionToken to create temporary credentials, go to <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getsessiontoken\">Temporary Credentials for Users in Untrusted Environments in the IAM User Guide.

",
"operationId": "GetSessionToken",
"parameters": [
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"$ref": "#/definitions/GetSessionTokenRequest"
}
}
],
"responses": {
"200": {
"description": "Success",
"schema": {
"$ref": "#/definitions/GetSessionTokenResponse"
}
},
"480": {
"description": "RegionDisabledException",
"schema": {
"$ref": "#/definitions/RegionDisabledException"
}
}
}
}
}
},
"definitions": {
"AssumeRoleRequest": {
"example": {
"DurationSeconds": 3600,
"ExternalId": "123ABC",
"Policy": "{"Version":"2012-10-17","Statement":[{"Sid":"Stmt1","Effect":"Allow","Action":"s3:","Resource":""}]}",
"RoleArn": "arn:aws:iam::123456789012:role/demo",
"RoleSessionName": "Bob"
},
"properties": {
"DurationSeconds": {
"$ref": "#/definitions/roleDurationSecondsType",
"description": "

The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds.

This is separate from the duration of a console session that you might request using the returned credentials. The request to the federation endpoint for a console sign-in token takes a SessionDuration parameter that specifies the maximum length of the console session, separately from the DurationSeconds parameter on this API. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html\">Creating a URL that Enables Federated Users to Access the AWS Management Console in the IAM User Guide.

"
},
"ExternalId": {
"$ref": "#/definitions/externalIdType",
"description": "

A unique identifier that is used by third parties when assuming roles in their customers' accounts. For each role that the third party can assume, they should instruct their customers to ensure the role's trust policy checks for the external ID that the third party generated. Each time the third party assumes the role, they should pass the customer's external ID. The external ID is useful in order to help third parties bind a role to the customer who created it. For more information about the external ID, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html\">How to Use an External ID When Granting Access to Your AWS Resources to a Third Party in the IAM User Guide.

The regex used to validated this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/-

"
},
"Policy": {
"$ref": "#/definitions/sessionPolicyDocumentType",
"description": "

An IAM policy in JSON format.

This parameter is optional. If you pass a policy, the temporary security credentials that are returned by the operation have the permissions that are allowed by both (the intersection of) the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html\">Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity in the IAM User Guide.

The format for this parameter, as described by its regex pattern, is a string of characters up to 2048 characters in length. The characters can be any ASCII character from the space character to the end of the valid character list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters.

The policy plain text must be 2048 bytes or shorter. However, an internal conversion compresses it into a packed binary format with a separate limit. The PackedPolicySize response element indicates by percentage how close to the upper size limit the policy is, with 100% equaling the maximum allowed size.

"
},
"RoleArn": {
"$ref": "#/definitions/arnType",
"description": "The Amazon Resource Name (ARN) of the role to assume."
},
"RoleSessionName": {
"$ref": "#/definitions/roleSessionNameType",
"description": "

An identifier for the assumed role session.

Use the role session name to uniquely identify a session when the same role is assumed by different principals or for different reasons. In cross-account scenarios, the role session name is visible to, and can be logged by the account that owns the role. The role session name is also used in the ARN of the assumed role principal. This means that subsequent cross-account API requests using the temporary security credentials will expose the role session name to the external account in their CloudTrail logs.

The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-

"
},
"SerialNumber": {
"$ref": "#/definitions/serialNumberType",
"description": "

The identification number of the MFA device that is associated with the user who is making the AssumeRole call. Specify this value if the trust policy of the role being assumed includes a condition that requires MFA authentication. The value is either the serial number for a hardware device (such as GAHT12345678) or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user).

The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-

"
},
"TokenCode": {
"$ref": "#/definitions/tokenCodeType",
"description": "

The value provided by the MFA device, if the trust policy of the role being assumed requires MFA (that is, if the policy includes a condition that tests for MFA). If the role being assumed requires MFA and if the TokenCode value is missing or expired, the AssumeRole call returns an "access denied" error.

The format for this parameter, as described by its regex pattern, is a sequence of six numeric digits.

"
}
},
"required": [
"RoleArn",
"RoleSessionName"
],
"type": "object"
},
"AssumeRoleResponse": {
"description": "Contains the response to a successful AssumeRole request, including temporary AWS credentials that can be used to make AWS requests. ",
"example": {
"AssumedRoleUser": {
"Arn": "arn:aws:sts::123456789012:assumed-role/demo/Bob",
"AssumedRoleId": "ARO123EXAMPLE123:Bob"
},
"Credentials": {
"AccessKeyId": "AKIAIOSFODNN7EXAMPLE",
"Expiration": "2011-07-15T23:28:33.359Z",
"SecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY",
"SessionToken": "AQoDYXdzEPT//////////wEXAMPLEtc764bNrC9SAPBSM22wDOk4x4HIZ8j4FZTwdQWLWsKWHGBuFqwAeMicRXmxfpSPfIeoIYRqTflfKD8YUuwthAx7mSEI/qkPpKPi/kMcGdQrmGdeehM4IC1NtBmUpp2wUE8phUZampKsburEDy0KPkyQDYwT7WZ0wq5VSXDvp75YU9HFvlRd8Tx6q6fE8YQcHNVXAkiY9q6d+xo0rKwT38xVqr7ZD0u0iPPkUL64lIZbqBAz+scqKmlzm8FDrypNC9Yjc8fPOLn9FX9KSYvKTr4rvx3iSIlTJabIQwj2ICCR/oLxBA=="
},
"PackedPolicySize": 6
},
"properties": {
"AssumedRoleUser": {
"$ref": "#/definitions/AssumedRoleUser",
"description": "The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers that you can use to refer to the resulting temporary security credentials. For example, you can reference these credentials as a principal in a resource-based policy by using the ARN or assumed role ID. The ARN and ID include the RoleSessionName that you specified when you called AssumeRole. "
},
"Credentials": {
"$ref": "#/definitions/Credentials",
"description": "

The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.

Note: The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.

"
},
"PackedPolicySize": {
"$ref": "#/definitions/nonNegativeIntegerType",
"description": "A percentage value that indicates the size of the policy in packed form. The service rejects any policy with a packed size greater than 100 percent, which means the policy exceeded the allowed space."
}
},
"type": "object"
},
"AssumeRoleWithSAMLRequest": {
"properties": {
"DurationSeconds": {
"$ref": "#/definitions/roleDurationSecondsType",
"description": "

The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds. An expiration can also be specified in the SAML authentication response's SessionNotOnOrAfter value. The actual expiration time is whichever value is shorter.

This is separate from the duration of a console session that you might request using the returned credentials. The request to the federation endpoint for a console sign-in token takes a SessionDuration parameter that specifies the maximum length of the console session, separately from the DurationSeconds parameter on this API. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-saml.html\">Enabling SAML 2.0 Federated Users to Access the AWS Management Console in the IAM User Guide.

"
},
"Policy": {
"$ref": "#/definitions/sessionPolicyDocumentType",
"description": "

An IAM policy in JSON format.

The policy parameter is optional. If you pass a policy, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html\">Permissions for AssumeRole, AssumeRoleWithSAML, and AssumeRoleWithWebIdentity in the IAM User Guide.

The format for this parameter, as described by its regex pattern, is a string of characters up to 2048 characters in length. The characters can be any ASCII character from the space character to the end of the valid character list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters.

The policy plain text must be 2048 bytes or shorter. However, an internal conversion compresses it into a packed binary format with a separate limit. The PackedPolicySize response element indicates by percentage how close to the upper size limit the policy is, with 100% equaling the maximum allowed size.

"
},
"PrincipalArn": {
"$ref": "#/definitions/arnType",
"description": "The Amazon Resource Name (ARN) of the SAML provider in IAM that describes the IdP."
},
"RoleArn": {
"$ref": "#/definitions/arnType",
"description": "The Amazon Resource Name (ARN) of the role that the caller is assuming."
},
"SAMLAssertion": {
"$ref": "#/definitions/SAMLAssertionType",
"description": "

The base-64 encoded SAML authentication response provided by the IdP.

For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/create-role-saml-IdP-tasks.html\">Configuring a Relying Party and Adding Claims in the Using IAM guide.

"
}
},
"required": [
"RoleArn",
"PrincipalArn",
"SAMLAssertion"
],
"type": "object"
},
"AssumeRoleWithSAMLResponse": {
"description": "Contains the response to a successful AssumeRoleWithSAML request, including temporary AWS credentials that can be used to make AWS requests. ",
"properties": {
"AssumedRoleUser": {
"$ref": "#/definitions/AssumedRoleUser",
"description": "The identifiers for the temporary security credentials that the operation returns."
},
"Audience": {
"$ref": "#/definitions/Audience",
"description": " The value of the Recipient attribute of the SubjectConfirmationData element of the SAML assertion. "
},
"Credentials": {
"$ref": "#/definitions/Credentials",
"description": "

The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.

Note: The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.

"
},
"Issuer": {
"$ref": "#/definitions/Issuer",
"description": "The value of the Issuer element of the SAML assertion."
},
"NameQualifier": {
"$ref": "#/definitions/NameQualifier",
"description": "

A hash value based on the concatenation of the Issuer response value, the AWS account ID, and the friendly name (the last part of the ARN) of the SAML provider in IAM. The combination of NameQualifier and Subject can be used to uniquely identify a federated user.

The following pseudocode shows how the hash value is calculated:

BASE64 ( SHA1 ( "https://example.com/saml\" + "123456789012" + "/MySAMLIdP" ) )

"
},
"PackedPolicySize": {
"$ref": "#/definitions/nonNegativeIntegerType",
"description": "A percentage value that indicates the size of the policy in packed form. The service rejects any policy with a packed size greater than 100 percent, which means the policy exceeded the allowed space."
},
"Subject": {
"$ref": "#/definitions/Subject",
"description": "The value of the NameID element in the Subject element of the SAML assertion."
},
"SubjectType": {
"$ref": "#/definitions/SubjectType",
"description": "

The format of the name ID, as defined by the Format attribute in the NameID element of the SAML assertion. Typical examples of the format are transient or persistent.

If the format includes the prefix urn:oasis:names:tc:SAML:2.0:nameid-format, that prefix is removed. For example, urn:oasis:names:tc:SAML:2.0:nameid-format:transient is returned as transient. If the format includes any other prefix, the format is returned with no modifications.

"
}
},
"type": "object"
},
"AssumeRoleWithWebIdentityRequest": {
"example": {
"DurationSeconds": 3600,
"ProviderId": "www.amazon.com",
"RoleArn": "arn:aws:iam::123456789012:role/FederatedWebIdentityRole",
"RoleSessionName": "app1",
"WebIdentityToken": "Atza%7CIQEBLjAsAhRFiXuWpUXuRvQ9PZL3GMFcYevydwIUFAHZwXZXXXXXXXXJnrulxKDHwy87oGKPznh0D6bEQZTSCzyoCtL_8S07pLpr0zMbn6w1lfVZKNTBdDansFBmtGnIsIapjI6xKR02Yc_2bQ8LZbUXSGm6Ry6_BG7PrtLZtj_dfCTj92xNGed-CrKqjG7nPBjNIL016GGvuS5gSvPRUxWES3VYfm1wl7WTI7jn-Pcb6M-buCgHhFOzTQxod27L9CqnOLio7N3gZAGpsp6n1-AJBOCJckcyXe2c6uD0srOJeZlKUm2eTDVMf8IehDVI0r1QOnTV6KzzAI3OY87Vd_cVMQ"
},
"properties": {
"DurationSeconds": {
"$ref": "#/definitions/roleDurationSecondsType",
"description": "

The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) to 3600 seconds (1 hour). By default, the value is set to 3600 seconds.

This is separate from the duration of a console session that you might request using the returned credentials. The request to the federation endpoint for a console sign-in token takes a SessionDuration parameter that specifies the maximum length of the console session, separately from the DurationSeconds parameter on this API. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_providers_enable-console-custom-url.html\">Creating a URL that Enables Federated Users to Access the AWS Management Console in the IAM User Guide.

"
},
"Policy": {
"$ref": "#/definitions/sessionPolicyDocumentType",
"description": "

An IAM policy in JSON format.

The policy parameter is optional. If you pass a policy, the temporary security credentials that are returned by the operation have the permissions that are allowed by both the access policy of the role that is being assumed, and the policy that you pass. This gives you a way to further restrict the permissions for the resulting temporary security credentials. You cannot use the passed policy to grant permissions that are in excess of those allowed by the access policy of the role that is being assumed. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_assumerole.html\">Permissions for AssumeRoleWithWebIdentity in the IAM User Guide.

The format for this parameter, as described by its regex pattern, is a string of characters up to 2048 characters in length. The characters can be any ASCII character from the space character to the end of the valid character list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters.

The policy plain text must be 2048 bytes or shorter. However, an internal conversion compresses it into a packed binary format with a separate limit. The PackedPolicySize response element indicates by percentage how close to the upper size limit the policy is, with 100% equaling the maximum allowed size.

"
},
"ProviderId": {
"$ref": "#/definitions/urlType",
"description": "

The fully qualified host component of the domain name of the identity provider.

Specify this value only for OAuth 2.0 access tokens. Currently www.amazon.com and graph.facebook.com are the only supported identity providers for OAuth 2.0 access tokens. Do not include URL schemes and port numbers.

Do not specify this value for OpenID Connect ID tokens.

"
},
"RoleArn": {
"$ref": "#/definitions/arnType",
"description": "The Amazon Resource Name (ARN) of the role that the caller is assuming."
},
"RoleSessionName": {
"$ref": "#/definitions/roleSessionNameType",
"description": "

An identifier for the assumed role session. Typically, you pass the name or identifier that is associated with the user who is using your application. That way, the temporary security credentials that your application will use are associated with that user. This session name is included as part of the ARN and assumed role ID in the AssumedRoleUser response element.

The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-

"
},
"WebIdentityToken": {
"$ref": "#/definitions/clientTokenType",
"description": "The OAuth 2.0 access token or OpenID Connect ID token that is provided by the identity provider. Your application must get this token by authenticating the user who is using your application with a web identity provider before the application makes an AssumeRoleWithWebIdentity call. "
}
},
"required": [
"RoleArn",
"RoleSessionName",
"WebIdentityToken"
],
"type": "object"
},
"AssumeRoleWithWebIdentityResponse": {
"description": "Contains the response to a successful AssumeRoleWithWebIdentity request, including temporary AWS credentials that can be used to make AWS requests. ",
"example": {
"AssumedRoleUser": {
"Arn": "arn:aws:sts::123456789012:assumed-role/FederatedWebIdentityRole/app1",
"AssumedRoleId": "AROACLKWSDQRAOEXAMPLE:app1"
},
"Audience": "[email protected]",
"Credentials": {
"AccessKeyId": "AKIAIOSFODNN7EXAMPLE",
"Expiration": "2014-10-24T23:00:23Z",
"SecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY",
"SessionToken": "AQoDYXdzEE0a8ANXXXXXXXXNO1ewxE5TijQyp+IEXAMPLE"
},
"PackedPolicySize": 123,
"Provider": "www.amazon.com",
"SubjectFromWebIdentityToken": "amzn1.account.AF6RHO7KZU5XRVQJGXK6HEXAMPLE"
},
"properties": {
"AssumedRoleUser": {
"$ref": "#/definitions/AssumedRoleUser",
"description": "The Amazon Resource Name (ARN) and the assumed role ID, which are identifiers that you can use to refer to the resulting temporary security credentials. For example, you can reference these credentials as a principal in a resource-based policy by using the ARN or assumed role ID. The ARN and ID include the RoleSessionName that you specified when you called AssumeRole. "
},
"Audience": {
"$ref": "#/definitions/Audience",
"description": "The intended audience (also known as client ID) of the web identity token. This is traditionally the client identifier issued to the application that requested the web identity token."
},
"Credentials": {
"$ref": "#/definitions/Credentials",
"description": "

The temporary security credentials, which include an access key ID, a secret access key, and a security token.

Note: The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.

"
},
"PackedPolicySize": {
"$ref": "#/definitions/nonNegativeIntegerType",
"description": "A percentage value that indicates the size of the policy in packed form. The service rejects any policy with a packed size greater than 100 percent, which means the policy exceeded the allowed space."
},
"Provider": {
"$ref": "#/definitions/Issuer",
"description": " The issuing authority of the web identity token presented. For OpenID Connect ID Tokens this contains the value of the iss field. For OAuth 2.0 access tokens, this contains the value of the ProviderId parameter that was passed in the AssumeRoleWithWebIdentity request."
},
"SubjectFromWebIdentityToken": {
"$ref": "#/definitions/webIdentitySubjectType",
"description": "The unique user identifier that is returned by the identity provider. This identifier is associated with the WebIdentityToken that was submitted with the AssumeRoleWithWebIdentity call. The identifier is typically unique to the user and the application that acquired the WebIdentityToken (pairwise identifier). For OpenID Connect ID tokens, this field contains the value returned by the identity provider as the token's sub (Subject) claim. "
}
},
"type": "object"
},
"AssumedRoleUser": {
"description": "The identifiers for the temporary security credentials that the operation returns.",
"properties": {
"Arn": {
"$ref": "#/definitions/arnType",
"description": "The ARN of the temporary security credentials that are returned from the AssumeRole action. For more information about ARNs and how to use them in policies, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html\">IAM Identifiers in Using IAM. "
},
"AssumedRoleId": {
"$ref": "#/definitions/assumedRoleIdType",
"description": "A unique identifier that contains the role ID and the role session name of the role that is being assumed. The role ID is generated by AWS when the role is created."
}
},
"required": [
"AssumedRoleId",
"Arn"
],
"type": "object"
},
"Audience": {
"type": "string"
},
"Credentials": {
"description": "AWS credentials for API authentication.",
"properties": {
"AccessKeyId": {
"$ref": "#/definitions/accessKeyIdType",
"description": "The access key ID that identifies the temporary security credentials."
},
"Expiration": {
"$ref": "#/definitions/dateType",
"description": "The date on which the current credentials expire."
},
"SecretAccessKey": {
"$ref": "#/definitions/accessKeySecretType",
"description": "The secret access key that can be used to sign requests."
},
"SessionToken": {
"$ref": "#/definitions/tokenType",
"description": "The token that users must pass to the service API to use the temporary credentials."
}
},
"required": [
"AccessKeyId",
"SecretAccessKey",
"SessionToken",
"Expiration"
],
"type": "object"
},
"DecodeAuthorizationMessageRequest": {
"example": {
"EncodedMessage": ""
},
"properties": {
"EncodedMessage": {
"$ref": "#/definitions/encodedMessageType",
"description": "The encoded message that was returned with the response."
}
},
"required": [
"EncodedMessage"
],
"type": "object"
},
"DecodeAuthorizationMessageResponse": {
"description": "A document that contains additional information about the authorization status of a request from an encoded message that is returned in response to an AWS request.",
"example": {
"DecodedMessage": "{"allowed": "false","explicitDeny": "false","matchedStatements": "","failures": "","context": {"principal": {"id": "AIDACKCEVSQ6C2EXAMPLE","name": "Bob","arn": "arn:aws:iam::123456789012:user/Bob"},"action": "ec2:StopInstances","resource": "arn:aws:ec2:us-east-1:123456789012:instance/i-dd01c9bd","conditions": [{"item": {"key": "ec2:Tenancy","values": ["default"]},{"item": {"key": "ec2:ResourceTag/elasticbeanstalk:environment-name","values": ["Default-Environment"]}},(Additional items ...)]}}"
},
"properties": {
"DecodedMessage": {
"$ref": "#/definitions/decodedMessageType",
"description": "An XML document that contains the decoded message."
}
},
"type": "object"
},
"ExpiredTokenException": {
"description": "The web identity token that was passed is expired or is not valid. Get a new identity token from the identity provider and then retry the request.",
"properties": {
"message": {
"$ref": "#/definitions/expiredIdentityTokenMessage"
}
},
"type": "object"
},
"FederatedUser": {
"description": "Identifiers for the federated user that is associated with the credentials.",
"properties": {
"Arn": {
"$ref": "#/definitions/arnType",
"description": "The ARN that specifies the federated user that is associated with the credentials. For more information about ARNs and how to use them in policies, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html\">IAM Identifiers in Using IAM. "
},
"FederatedUserId": {
"$ref": "#/definitions/federatedIdType",
"description": "The string that identifies the federated user associated with the credentials, similar to the unique ID of an IAM user."
}
},
"required": [
"FederatedUserId",
"Arn"
],
"type": "object"
},
"GetCallerIdentityRequest": {
"example": {},
"properties": {},
"type": "object"
},
"GetCallerIdentityResponse": {
"description": "Contains the response to a successful GetCallerIdentity request, including information about the entity making the request.",
"example": {
"Account": "123456789012",
"Arn": "arn:aws:sts::123456789012:federated-user/my-federated-user-name",
"UserId": "123456789012:my-federated-user-name"
},
"properties": {
"Account": {
"$ref": "#/definitions/accountType",
"description": "The AWS account ID number of the account that owns or contains the calling entity."
},
"Arn": {
"$ref": "#/definitions/arnType",
"description": "The AWS ARN associated with the calling entity."
},
"UserId": {
"$ref": "#/definitions/userIdType",
"description": "The unique identifier of the calling entity. The exact value depends on the type of entity making the call. The values returned are those listed in the aws:userid column in the <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable\">Principal table found on the Policy Variables reference page in the IAM User Guide."
}
},
"type": "object"
},
"GetFederationTokenRequest": {
"example": {
"DurationSeconds": 3600,
"Name": "Bob",
"Policy": "{"Version":"2012-10-17","Statement":[{"Sid":"Stmt1","Effect":"Allow","Action":"s3:","Resource":""}]}"
},
"properties": {
"DurationSeconds": {
"$ref": "#/definitions/durationSecondsType",
"description": "The duration, in seconds, that the session should last. Acceptable durations for federation sessions range from 900 seconds (15 minutes) to 129600 seconds (36 hours), with 43200 seconds (12 hours) as the default. Sessions obtained using AWS account (root) credentials are restricted to a maximum of 3600 seconds (one hour). If the specified duration is longer than one hour, the session obtained by using AWS account (root) credentials defaults to one hour."
},
"Name": {
"$ref": "#/definitions/userNameType",
"description": "

The name of the federated user. The name is used as an identifier for the temporary security credentials (such as Bob). For example, you can reference the federated user name in a resource-based policy, such as in an Amazon S3 bucket policy.

The regex used to validate this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@-

"
},
"Policy": {
"$ref": "#/definitions/sessionPolicyDocumentType",
"description": "

An IAM policy in JSON format that is passed with the GetFederationToken call and evaluated along with the policy or policies that are attached to the IAM user whose credentials are used to call GetFederationToken. The passed policy is used to scope down the permissions that are available to the IAM user, by allowing only a subset of the permissions that are granted to the IAM user. The passed policy cannot grant more permissions than those granted to the IAM user. The final permissions for the federated user are the most restrictive set based on the intersection of the passed policy and the IAM user policy.

If you do not pass a policy, the resulting temporary security credentials have no effective permissions. The only exception is when the temporary security credentials are used to access a resource that has a resource-based policy that specifically allows the federated user to access the resource.

The format for this parameter, as described by its regex pattern, is a string of characters up to 2048 characters in length. The characters can be any ASCII character from the space character to the end of the valid character list (\u0020-\u00FF). It can also include the tab (\u0009), linefeed (\u000A), and carriage return (\u000D) characters.

The policy plain text must be 2048 bytes or shorter. However, an internal conversion compresses it into a packed binary format with a separate limit. The PackedPolicySize response element indicates by percentage how close to the upper size limit the policy is, with 100% equaling the maximum allowed size.

For more information about how permissions work, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_control-access_getfederationtoken.html\">Permissions for GetFederationToken.

"
}
},
"required": [
"Name"
],
"type": "object"
},
"GetFederationTokenResponse": {
"description": "Contains the response to a successful GetFederationToken request, including temporary AWS credentials that can be used to make AWS requests. ",
"example": {
"Credentials": {
"AccessKeyId": "AKIAIOSFODNN7EXAMPLE",
"Expiration": "2011-07-15T23:28:33.359Z",
"SecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY",
"SessionToken": "AQoDYXdzEPT//////////wEXAMPLEtc764bNrC9SAPBSM22wDOk4x4HIZ8j4FZTwdQWLWsKWHGBuFqwAeMicRXmxfpSPfIeoIYRqTflfKD8YUuwthAx7mSEI/qkPpKPi/kMcGdQrmGdeehM4IC1NtBmUpp2wUE8phUZampKsburEDy0KPkyQDYwT7WZ0wq5VSXDvp75YU9HFvlRd8Tx6q6fE8YQcHNVXAkiY9q6d+xo0rKwT38xVqr7ZD0u0iPPkUL64lIZbqBAz+scqKmlzm8FDrypNC9Yjc8fPOLn9FX9KSYvKTr4rvx3iSIlTJabIQwj2ICCR/oLxBA=="
},
"FederatedUser": {
"Arn": "arn:aws:sts::123456789012:federated-user/Bob",
"FederatedUserId": "123456789012:Bob"
},
"PackedPolicySize": 6
},
"properties": {
"Credentials": {
"$ref": "#/definitions/Credentials",
"description": "

The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.

Note: The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.

"
},
"FederatedUser": {
"$ref": "#/definitions/FederatedUser",
"description": "Identifiers for the federated user associated with the credentials (such as arn:aws:sts::123456789012:federated-user/Bob or 123456789012:Bob). You can use the federated user's ARN in your resource-based policies, such as an Amazon S3 bucket policy. "
},
"PackedPolicySize": {
"$ref": "#/definitions/nonNegativeIntegerType",
"description": "A percentage value indicating the size of the policy in packed form. The service rejects policies for which the packed size is greater than 100 percent of the allowed value."
}
},
"type": "object"
},
"GetSessionTokenRequest": {
"example": {
"DurationSeconds": 3600,
"SerialNumber": "YourMFASerialNumber",
"TokenCode": "123456"
},
"properties": {
"DurationSeconds": {
"$ref": "#/definitions/durationSecondsType",
"description": "The duration, in seconds, that the credentials should remain valid. Acceptable durations for IAM user sessions range from 900 seconds (15 minutes) to 129600 seconds (36 hours), with 43200 seconds (12 hours) as the default. Sessions for AWS account owners are restricted to a maximum of 3600 seconds (one hour). If the duration is longer than one hour, the session for AWS account owners defaults to one hour."
},
"SerialNumber": {
"$ref": "#/definitions/serialNumberType",
"description": "

The identification number of the MFA device that is associated with the IAM user who is making the GetSessionToken call. Specify this value if the IAM user has a policy that requires MFA authentication. The value is either the serial number for a hardware device (such as GAHT12345678) or an Amazon Resource Name (ARN) for a virtual device (such as arn:aws:iam::123456789012:mfa/user). You can find the device for an IAM user by going to the AWS Management Console and viewing the user's security credentials.

The regex used to validated this parameter is a string of characters consisting of upper- and lower-case alphanumeric characters with no spaces. You can also include underscores or any of the following characters: =,.@:/-

"
},
"TokenCode": {
"$ref": "#/definitions/tokenCodeType",
"description": "

The value provided by the MFA device, if MFA is required. If any policy requires the IAM user to submit an MFA code, specify this value. If MFA authentication is required, and the user does not provide a code when requesting a set of temporary security credentials, the user will receive an "access denied" response when requesting resources that require MFA authentication.

The format for this parameter, as described by its regex pattern, is a sequence of six numeric digits.

"
}
},
"type": "object"
},
"GetSessionTokenResponse": {
"description": "Contains the response to a successful GetSessionToken request, including temporary AWS credentials that can be used to make AWS requests. ",
"example": {
"Credentials": {
"AccessKeyId": "AKIAIOSFODNN7EXAMPLE",
"Expiration": "2011-07-11T19:55:29.611Z",
"SecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYzEXAMPLEKEY",
"SessionToken": "AQoEXAMPLEH4aoAH0gNCAPyJxz4BlCFFxWNE1OPTgk5TthT+FvwqnKwRcOIfrRh3c/LTo6UDdyJwOOvEVPvLXCrrrUtdnniCEXAMPLE/IvU1dYUg2RVAJBanLiHb4IgRmpRV3zrkuWJOgQs8IZZaIv2BXIa2R4OlgkBN9bkUDNCJiBeb/AXlzBBko7b15fjrBs2+cTQtpZ3CYWFXG8C5zqx37wnOE49mRl/+OtkIKGO7fAE"
}
},
"properties": {
"Credentials": {
"$ref": "#/definitions/Credentials",
"description": "

The temporary security credentials, which include an access key ID, a secret access key, and a security (or session) token.

Note: The size of the security token that STS APIs return is not fixed. We strongly recommend that you make no assumptions about the maximum size. As of this writing, the typical size is less than 4096 bytes, but that can vary. Also, future updates to AWS might require larger sizes.

"
}
},
"type": "object"
},
"IDPCommunicationErrorException": {
"description": "The request could not be fulfilled because the non-AWS identity provider (IDP) that was asked to verify the incoming identity token could not be reached. This is often a transient error caused by network conditions. Retry the request a limited number of times so that you don't exceed the request rate. If the error persists, the non-AWS identity provider might be down or not responding.",
"properties": {
"message": {
"$ref": "#/definitions/idpCommunicationErrorMessage"
}
},
"type": "object"
},
"IDPRejectedClaimException": {
"description": "

The identity provider (IdP) reported that authentication failed. This might be because the claim is invalid.

If this error is returned for the AssumeRoleWithWebIdentity operation, it can also mean that the claim has expired or has been explicitly revoked.

",
"properties": {
"message": {
"$ref": "#/definitions/idpRejectedClaimMessage"
}
},
"type": "object"
},
"InvalidAuthorizationMessageException": {
"description": "The error returned if the message passed to DecodeAuthorizationMessage was invalid. This can happen if the token contains invalid characters, such as linebreaks. ",
"properties": {
"message": {
"$ref": "#/definitions/invalidAuthorizationMessage"
}
},
"type": "object"
},
"InvalidIdentityTokenException": {
"description": "The web identity token that was passed could not be validated by AWS. Get a new identity token from the identity provider and then retry the request.",
"properties": {
"message": {
"$ref": "#/definitions/invalidIdentityTokenMessage"
}
},
"type": "object"
},
"Issuer": {
"type": "string"
},
"MalformedPolicyDocumentException": {
"description": "The request was rejected because the policy document was malformed. The error message describes the specific error.",
"properties": {
"message": {
"$ref": "#/definitions/malformedPolicyDocumentMessage"
}
},
"type": "object"
},
"NameQualifier": {
"type": "string"
},
"PackedPolicyTooLargeException": {
"description": "The request was rejected because the policy document was too large. The error message describes how big the policy document is, in packed form, as a percentage of what the API allows.",
"properties": {
"message": {
"$ref": "#/definitions/packedPolicyTooLargeMessage"
}
},
"type": "object"
},
"RegionDisabledException": {
"description": "STS is not activated in the requested region for the account that is being asked to generate credentials. The account administrator must use the IAM console to activate STS in that region. For more information, see <a href="http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html\">Activating and Deactivating AWS STS in an AWS Region in the IAM User Guide.",
"properties": {
"message": {
"$ref": "#/definitions/regionDisabledMessage"
}
},
"type": "object"
},
"SAMLAssertionType": {
"maxLength": 50000,
"minLength": 4,
"type": "string"
},
"Subject": {
"type": "string"
},
"SubjectType": {
"type": "string"
},
"accessKeyIdType": {
"maxLength": 128,
"minLength": 16,
"pattern": "[\w]",
"type": "string"
},
"accessKeySecretType": {
"type": "string"
},
"accountType": {
"type": "string"
},
"arnType": {
"maxLength": 2048,
"minLength": 20,
"pattern": "[\u0009\u000A\u000D\u0020-\u007E\u0085\u00A0-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]+",
"type": "string"
},
"assumedRoleIdType": {
"maxLength": 193,
"minLength": 2,
"pattern": "[\w+=,.@:-]
",
"type": "string"
},
"clientTokenType": {
"maxLength": 2048,
"minLength": 4,
"type": "string"
},
"dateType": {
"format": "date-time",
"type": "string"
},
"decodedMessageType": {
"type": "string"
},
"durationSecondsType": {
"maximum": 129600,
"minimum": 900,
"type": "integer"
},
"encodedMessageType": {
"maxLength": 10240,
"minLength": 1,
"type": "string"
},
"expiredIdentityTokenMessage": {
"type": "string"
},
"externalIdType": {
"maxLength": 1224,
"minLength": 2,
"pattern": "[\w+=,.@:\/-]",
"type": "string"
},
"federatedIdType": {
"maxLength": 193,
"minLength": 2,
"pattern": "[\w+=,.@\:-]
",
"type": "string"
},
"idpCommunicationErrorMessage": {
"type": "string"
},
"idpRejectedClaimMessage": {
"type": "string"
},
"invalidAuthorizationMessage": {
"type": "string"
},
"invalidIdentityTokenMessage": {
"type": "string"
},
"malformedPolicyDocumentMessage": {
"type": "string"
},
"nonNegativeIntegerType": {
"minimum": 0,
"type": "integer"
},
"packedPolicyTooLargeMessage": {
"type": "string"
},
"regionDisabledMessage": {
"type": "string"
},
"roleDurationSecondsType": {
"maximum": 3600,
"minimum": 900,
"type": "integer"
},
"roleSessionNameType": {
"maxLength": 64,
"minLength": 2,
"pattern": "[\w+=,.@-]",
"type": "string"
},
"serialNumberType": {
"maxLength": 256,
"minLength": 9,
"pattern": "[\w+=/:,.@-]
",
"type": "string"
},
"sessionPolicyDocumentType": {
"maxLength": 2048,
"minLength": 1,
"pattern": "[\u0009\u000A\u000D\u0020-\u00FF]+",
"type": "string"
},
"tokenCodeType": {
"maxLength": 6,
"minLength": 6,
"pattern": "[\d]",
"type": "string"
},
"tokenType": {
"type": "string"
},
"urlType": {
"maxLength": 2048,
"minLength": 4,
"type": "string"
},
"userIdType": {
"type": "string"
},
"userNameType": {
"maxLength": 32,
"minLength": 2,
"pattern": "[\w+=,.@-]
",
"type": "string"
},
"webIdentitySubjectType": {
"maxLength": 255,
"minLength": 6,
"type": "string"
}
}
}

webpack-example throws react error

Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).

Feature: Docker Image of minimal html page

Are there any plans to develop a docker image of the basic html page showcasing voyager? This would be helpful for managing more flexible deployments of the tool without having to worry about the host.

feature: ability to copy field lists

Feature:
copy to clipboard functionality (for the field list)

While you develop queries on the frontend for a GraphQL endpoint it would be handy to be able to copy field names directly from voyager to your queries..
At the moment this is painful because of the svg rendering.

Proposed solution:
A "copy button" (small clipboard icon in the top right corner of the boxes) which copies all the fields to the clipboard when the user clicks on it.

The copied text would look like this (simple list with line breaks):
name
description
whateverfield

I'm ready to jump into the implementation if the main contributors agree..

Ability to customize presets with custom endpoints

Hi ❤️❤️❤️ !!! This gem is awesome and will be a game changer, I've used the live demo with custom schemas a few times already.

We run a microservices architecture and we are slowly moving the APIs from REST to GraphQL and I am considering having an internal version of Voyager running so anyone in our organization can introspect and learn about the APIs we have available.

It seems like the presets like Star Wars, Yelp, Shopify, and Github are hard-coded here https://github.com/APIs-guru/graphql-voyager/blob/master/src/presets.ts and the result of the introspection query are stored here https://github.com/APIs-guru/graphql-voyager/tree/master/src/introspection/presets. For demo purposes this makes total sense.

My feature request is: it would be nice to be able to list a series of endpoints and their names and have them listed in Voyager in the landing page, Voyager would then perform the introspection query and show the latest schema.

I would imagine something like the following:

window.VOYAGER_PRESETS = {
  'clients': {url: 'https://clients.foo.com/api/graphql'},
  'accounts': {url: 'https://accounts.foo.com/v3/graph'},
  'orders': {url: 'https://orders-srv.foo.com/api/graphql'},
};

Related issues:

add ability to hide schemas

I'd love to be able to hide individual schemas (plus their connections) from the view.

The biggest use case is hiding the root query from the view.
Right now we have 20 queryable entities, which means there's 20 (redundant) links on the UI from just that.

I'd like to hide it so that we can make it easier to understand.

Using custom schema throws Unexpected token u in JSON error

When trying to run the demo at https://apis.guru/graphql-voyager/ with a custom schema from https://polar-reef-40902.herokuapp.com/graphiql I get the following error in the console.

Uncaught SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at n.handleChange (https://apis.guru/graphql-voyager/main.js:24:12961)
    at Object.ReactErrorUtils.invokeGuardedCallback (https://cdn.jsdelivr.net/react/15.4.2/react-dom.js:9017:16)
    at executeDispatch (https://cdn.jsdelivr.net/react/15.4.2/react-dom.js:3006:21)
    at Object.executeDispatchesInOrder (https://cdn.jsdelivr.net/react/15.4.2/react-dom.js:3029:5)
    at executeDispatchesAndRelease (https://cdn.jsdelivr.net/react/15.4.2/react-dom.js:2431:22)
    at executeDispatchesAndReleaseTopLevel (https://cdn.jsdelivr.net/react/15.4.2/react-dom.js:2442:10)
    at Array.forEach (native)
    at forEachAccumulated (https://cdn.jsdelivr.net/react/15.4.2/react-dom.js:15423:9)
    at Object.processEventQueue (https://cdn.jsdelivr.net/react/15.4.2/react-dom.js:2645:7)

The UI tells me that the JSON is valid when pasting the result into Custom Introspection field.

Any ideas to get me going? Maybe a bug?

Graph view not rendering

  • Using express middleware
  • Using graphql-voyager 1.0.0-rc5
  • Tried using Chrome / Safari

When I hit the graphql voyager endpoint, the sidebar loads properly, but the main view gets stuck on "Transmitting..."

image

In the JS console, I get blob:http://localhost:4000/427b21a8-5a9a-4f6f-8baf-463f5d906201:12 Uncaught SyntaxError: Illegal return statement

Which is buried in the bundle (under // ENSCRIPTEN_END_FUNCS)

;return{_i64Subtract:t6,_memset:u6,_bitshift64Lshr:z6,_bitshift64Shl:v6,_fflush:m4,_bitshift64Ashr:y6,_vizLastErrorMessage:Gb,_sbrk:H6,_memcpy:B6,_llvm_bswap_i32:K6,___muldi3:G6,___uremdi3:J6,_testSetjmp:A6,_llvm_cttz_i32:C6,_vizCreateFile:Hb,___udivmoddi4:D6,_realloc:n6,_i64Add:w6,_llvm_bswap_i16:L6,_emscripten_get_global_libc:G1,_htons:L4,___udivdi3:E6,___errno_location:L1,___muldsi3:F6,_vizRenderFromString:Ib,_saveSetjmp:x6,_free:l6,_dtextract:Pz,_memmove:I6,_malloc:k6,_memalign:q6,runPostSets:s6,stackAlloc:yb,stackSave:zb,stackRestore:Ab,establishStackSpace:Bb,setTempRet0:Db,getTempRet0:Eb,setThrew:Cb,stackAlloc:yb,stackSave:zb,stackRestore:Ab,establishStackSpace:Bb,setThrew:Cb,setTempRet0:Db,getTempRet0:Eb,dynCall_vi:M6,dynCall_iiii:N6,dynCall_viiiii:O6,dynCall_d:P6,dynCall_di:Q6,dynCall_i:R6,dynCall_iiiiiiiiiii:S6,dynCall_iiidd:T6,dynCall_vii:U6,dynCall_iiiiiii:V6,dynCall_viiiddi:W6,dynCall_viiiiiiiii:X6,dynCall_ii:Y6,dynCall_dddd:Z6,dynCall_viii:_6,dynCall_v:$6,dynCall_iiiii:a7,dynCall_viiiiii:b7,dynCall_iii:c7,dynCall_iiiiii:d7,dynCall_viiii:e7}})

Unsure if this matters, but the generated bundle reads rc-4 instead of 5.

/*!
 * GraphQL Voyager - Represent any GraphQL API as an interactive graph
 * -------------------------------------------------------------
 *   Version: "1.0.0-rc.4"
 *   Repo: https://github.com/APIs-guru/graphql-voyager
 */

Feature: Display option to hide interface fields on implementations

With any moderately complex graph using interfaces, duplication of the fields on all implementations of the interface causes the visualisation to become overly complicated and full of (arguably) redundant relationships.

For example, take the following screenshot:
screen shot 2017-10-26 at 13 02 46

In this case SlatePlayer defines > 6 relations on fields, and (currently) has 3 implementations of the interface. This results in 18 additional lines on the graph, which really I can infer from the fact that the MlbSlatePlayer is an implementation of the SlatePlayer interface.

I would propose a display option to hide fields that are common to their interface to optionally reduce noise.

Accept endpoint URL and make POST queries automatically

It would be nice not to have to make the query and paste the result, even if it requires adding a CORS exception to my server (or deploying my own copy).

(This is partially the result of the size of the introspected schema JSON object, ~6.3 Mb compared to the built-ins which are 800k at most.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.