Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STS: add support for signing requests with assume_role tokens #117

Merged
merged 21 commits into from
Dec 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
58c4043
first pass at support session tokens.
akama Jan 20, 2021
7179b6b
Merge branch 'master' of https://github.com/inhabitedtype/ocaml-aws i…
zbaylin Nov 4, 2021
8f66549
CI: use updated `ocaml-compiler` over `ocaml-version`
zbaylin Nov 7, 2021
980ec15
Templates: update test template with new runner API
zbaylin Nov 20, 2021
b6c01c9
Re-run `make gen`
zbaylin Nov 20, 2021
c4444b3
Aws_gen: add additional_libraries field to dune gen
zbaylin Nov 20, 2021
7ec9a82
Lib_test(s): update to use new runner api
zbaylin Nov 20, 2021
fb7d49e
Sts_test: add assume_role and token authentication tests
zbaylin Nov 20, 2021
0b0a593
Formatting`
zbaylin Nov 22, 2021
d8e4898
OPAM: constrain ppx_tools_versioned
zbaylin Nov 22, 2021
dc7ab4a
CI: use ocaml-compiler over ocaml-version
zbaylin Nov 22, 2021
8435211
Sts_test: add documentation
zbaylin Nov 22, 2021
717ae97
OPAM: revert changes and regenerate STS
zbaylin Dec 12, 2021
367b363
added autoscaling special case for generating lib_test, added better …
bleepbloopsify Nov 29, 2021
b46192d
ocaml-version to ocaml-compiler
bleepbloopsify Dec 12, 2021
b866458
need to rename more variables
bleepbloopsify Dec 12, 2021
102295c
Merge branch 'leon/gen-fixes' of https://github.com/skolemlabs/ocaml-…
zbaylin Dec 12, 2021
5e3e783
Async/Lwt: add odoc documentation for ?token
zbaylin Dec 13, 2021
7052684
S3: remove generated test code
zbaylin Dec 13, 2021
0e324c5
Merge branch 'master' of https://github.com/inhabitedtype/ocaml-aws i…
zbaylin Dec 13, 2021
11c8a82
CHANGES: add entry
zbaylin Dec 13, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
----------
- Increase lower bound on OCaml to 4.08. https://github.com/inhabitedtype/ocaml-aws/pull/104
- Migrate CI to github actions https://github.com/inhabitedtype/ocaml-aws/pull/104
- Add STS `assume_role` token support https://github.com/inhabitedtype/ocaml-aws/pull/117

1.2: (24-01-2020)
----------
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ clean:
rm -rf _build *.install

fmt:
dune build @fmt --auto-promote
dune build @fmt --auto-promote || echo "format has errors, ignoring"

.PHONY: endpoints

Expand All @@ -26,9 +26,11 @@ endpoints:
aws-ec2:
dune exec aws-gen -- --is-ec2 -i input/ec2/latest/service-2.json -r input/ec2/overrides.json -e input/errors.json -o libraries

aws-autoscaling:
dune exec aws-gen -- -i input/autoscaling/latest/service-2.json -r input/autoscaling/overrides.json -e input/errors.json -o libraries --optional-libs=aws-ec2

# NOTE: This does not include aws-ec2, which is special-cased.
LIBRARIES := \
aws-autoscaling \
aws-cloudformation \
aws-cloudtrail \
aws-cloudwatch \
Expand All @@ -45,7 +47,7 @@ LIBRARIES := \
$(LIBRARIES): aws-%:
dune exec aws-gen -- -i input/$*/latest/service-2.json -r input/$*/overrides.json -e input/errors.json -o libraries

gen: build aws-ec2 $(LIBRARIES)
gen: build aws-ec2 aws-autoscaling $(LIBRARIES) fmt

update-version: VERSION=$(shell cat CHANGES.md | grep -E '^[0-9]' | head -n 1 | cut -f1 -d':' )
update-version:
Expand Down
3 changes: 3 additions & 0 deletions async/runtime.ml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ let run_request
~region
~access_key
~secret_key
?token
(module M : Aws.Call
with type input = input
and type output = output
Expand All @@ -55,13 +56,15 @@ let run_request
Aws.Signing.sign_request
~access_key
~secret_key
?token
~service:M.service
~region
(M.to_http M.service region inp)
| V2 ->
Aws.Signing.sign_v2_request
~access_key
~secret_key
?token
~service:M.service
~region
(M.to_http M.service region inp)
Expand Down
4 changes: 3 additions & 1 deletion async/runtime.mli
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ val run_request :
region:string
-> access_key:string
-> secret_key:string
-> ?token:string
tmcgilchrist marked this conversation as resolved.
Show resolved Hide resolved
-> ('input, 'output, 'error) Aws.call
-> 'input
-> [ `Ok of 'output | `Error of 'error Aws.Error.t ] Async.Deferred.t
(** Run an AWS request, in the [region] with [access_key] and [secret_key]. *)
(** Run an AWS request, in the [region] with [access_key] and [secret_key].
* An STS assume_role [token] can be optionally used to sign the request. *)
11 changes: 6 additions & 5 deletions aws-autoscaling.opam
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ version: "1.2"
synopsis: "Amazon Web Services SDK bindings to Auto Scaling"
description: "Amazon Web Services SDK bindings to Auto Scaling"
maintainer: "Tim McGilchrist <[email protected]>"
authors: [ "Spiros Eliopoulos <[email protected]>"
"Daniel Patterson <[email protected]>"
"Tim McGilchrist <[email protected]>"
]
authors: [
"Spiros Eliopoulos <[email protected]>"
"Daniel Patterson <[email protected]>"
"Tim McGilchrist <[email protected]>"
]
license: "BSD-3-clause"
homepage: "https://github.com/inhabitedtype/ocaml-aws"
dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git"
bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues"
doc: "https://github.com/inhabitedtype/ocaml-aws"
dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git"
depends: [
"ocaml" {>= "4.08"}
"aws" {= version}
Expand Down
6 changes: 3 additions & 3 deletions aws-cloudformation.opam
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ version: "1.2"
synopsis: "Amazon Web Services SDK bindings to AWS CloudFormation"
description: "Amazon Web Services SDK bindings to AWS CloudFormation"
maintainer: "Tim McGilchrist <[email protected]>"
authors: [
authors: [
"Spiros Eliopoulos <[email protected]>"
"Daniel Patterson <[email protected]>"
"Tim McGilchrist <[email protected]>"
]
license: "BSD-3-clause"
homepage: "https://github.com/inhabitedtype/ocaml-aws"
doc: "https://github.com/inhabitedtype/ocaml-aws"
bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues"
doc: "https://github.com/inhabitedtype/ocaml-aws"
dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git"
depends: [
"ocaml" {>= "4.08"}
Expand All @@ -28,4 +28,4 @@ depends: [
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
]
6 changes: 3 additions & 3 deletions aws-cloudtrail.opam
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ version: "1.2"
synopsis: "Amazon Web Services SDK bindings to AWS CloudTrail"
description: "Amazon Web Services SDK bindings to AWS CloudTrail"
maintainer: "Tim McGilchrist <[email protected]>"
authors: [
authors: [
"Spiros Eliopoulos <[email protected]>"
"Daniel Patterson <[email protected]>"
"Tim McGilchrist <[email protected]>"
]
license: "BSD-3-clause"
homepage: "https://github.com/inhabitedtype/ocaml-aws"
doc: "https://github.com/inhabitedtype/ocaml-aws"
bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues"
doc: "https://github.com/inhabitedtype/ocaml-aws"
dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git"
depends: [
"ocaml" {>= "4.08"}
Expand All @@ -28,4 +28,4 @@ depends: [
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
]
6 changes: 3 additions & 3 deletions aws-cloudwatch.opam
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ version: "1.2"
synopsis: "Amazon Web Services SDK bindings to Amazon CloudWatch"
description: "Amazon Web Services SDK bindings to Amazon CloudWatch"
maintainer: "Tim McGilchrist <[email protected]>"
authors: [
authors: [
"Spiros Eliopoulos <[email protected]>"
"Daniel Patterson <[email protected]>"
"Tim McGilchrist <[email protected]>"
]
license: "BSD-3-clause"
homepage: "https://github.com/inhabitedtype/ocaml-aws"
doc: "https://github.com/inhabitedtype/ocaml-aws"
bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues"
doc: "https://github.com/inhabitedtype/ocaml-aws"
dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git"
depends: [
"ocaml" {>= "4.08"}
Expand All @@ -28,4 +28,4 @@ depends: [
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
]
6 changes: 3 additions & 3 deletions aws-ec2.opam
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ version: "1.2"
synopsis: "Amazon Web Services SDK bindings to Amazon Elastic Compute Cloud"
description: "Amazon Web Services SDK bindings to Amazon Elastic Compute Cloud"
maintainer: "Tim McGilchrist <[email protected]>"
authors: [
authors: [
"Spiros Eliopoulos <[email protected]>"
"Daniel Patterson <[email protected]>"
"Tim McGilchrist <[email protected]>"
]
license: "BSD-3-clause"
homepage: "https://github.com/inhabitedtype/ocaml-aws"
doc: "https://github.com/inhabitedtype/ocaml-aws"
bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues"
doc: "https://github.com/inhabitedtype/ocaml-aws"
dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git"
depends: [
"ocaml" {>= "4.08"}
Expand All @@ -28,4 +28,4 @@ depends: [
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
]
6 changes: 3 additions & 3 deletions aws-elasticache.opam
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ version: "1.2"
synopsis: "Amazon Web Services SDK bindings to Amazon ElastiCache"
description: "Amazon Web Services SDK bindings to Amazon ElastiCache"
maintainer: "Tim McGilchrist <[email protected]>"
authors: [
authors: [
"Spiros Eliopoulos <[email protected]>"
"Daniel Patterson <[email protected]>"
"Tim McGilchrist <[email protected]>"
]
license: "BSD-3-clause"
homepage: "https://github.com/inhabitedtype/ocaml-aws"
doc: "https://github.com/inhabitedtype/ocaml-aws"
bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues"
doc: "https://github.com/inhabitedtype/ocaml-aws"
dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git"
depends: [
"ocaml" {>= "4.08"}
Expand All @@ -28,4 +28,4 @@ depends: [
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
]
6 changes: 3 additions & 3 deletions aws-elasticloadbalancing.opam
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ version: "1.2"
synopsis: "Amazon Web Services SDK bindings to Elastic Load Balancing"
description: "Amazon Web Services SDK bindings to Elastic Load Balancing"
maintainer: "Tim McGilchrist <[email protected]>"
authors: [
authors: [
"Spiros Eliopoulos <[email protected]>"
"Daniel Patterson <[email protected]>"
"Tim McGilchrist <[email protected]>"
]
license: "BSD-3-clause"
homepage: "https://github.com/inhabitedtype/ocaml-aws"
doc: "https://github.com/inhabitedtype/ocaml-aws"
bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues"
doc: "https://github.com/inhabitedtype/ocaml-aws"
dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git"
depends: [
"ocaml" {>= "4.08"}
Expand All @@ -28,4 +28,4 @@ depends: [
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
]
1 change: 1 addition & 0 deletions aws-gen.opam
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ depends: [
"yojson"
"base-unix"
"cmdliner"
"fmt"
"ppx_tools_versioned"
"yojson" {>= "1.6.0"}
"ocaml-migrate-parsetree"
Expand Down
12 changes: 5 additions & 7 deletions aws-rds.opam
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
opam-version: "2.0"
version: "1.2"
synopsis:
"Amazon Web Services SDK bindings to Amazon Relational Database Service"
description:
"Amazon Web Services SDK bindings to Amazon Relational Database Service"
synopsis: "Amazon Web Services SDK bindings to Amazon Relational Database Service"
description: "Amazon Web Services SDK bindings to Amazon Relational Database Service"
maintainer: "Tim McGilchrist <[email protected]>"
authors: [
authors: [
"Spiros Eliopoulos <[email protected]>"
"Daniel Patterson <[email protected]>"
"Tim McGilchrist <[email protected]>"
]
license: "BSD-3-clause"
homepage: "https://github.com/inhabitedtype/ocaml-aws"
doc: "https://github.com/inhabitedtype/ocaml-aws"
bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues"
doc: "https://github.com/inhabitedtype/ocaml-aws"
dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git"
depends: [
"ocaml" {>= "4.08"}
Expand All @@ -30,4 +28,4 @@ depends: [
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
]
6 changes: 3 additions & 3 deletions aws-route53.opam
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ version: "1.2"
synopsis: "Amazon Web Services SDK bindings to Amazon Route 53"
description: "Amazon Web Services SDK bindings to Amazon Route 53"
maintainer: "Tim McGilchrist <[email protected]>"
authors: [
authors: [
"Spiros Eliopoulos <[email protected]>"
"Daniel Patterson <[email protected]>"
"Tim McGilchrist <[email protected]>"
]
license: "BSD-3-clause"
homepage: "https://github.com/inhabitedtype/ocaml-aws"
doc: "https://github.com/inhabitedtype/ocaml-aws"
bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues"
doc: "https://github.com/inhabitedtype/ocaml-aws"
dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git"
depends: [
"ocaml" {>= "4.08"}
Expand All @@ -28,4 +28,4 @@ depends: [
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
]
6 changes: 3 additions & 3 deletions aws-sdb.opam
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ version: "1.2"
synopsis: "Amazon Web Services SDK bindings to Amazon SimpleDB"
description: "Amazon Web Services SDK bindings to Amazon SimpleDB"
maintainer: "Tim McGilchrist <[email protected]>"
authors: [
authors: [
"Spiros Eliopoulos <[email protected]>"
"Daniel Patterson <[email protected]>"
"Tim McGilchrist <[email protected]>"
]
license: "BSD-3-clause"
homepage: "https://github.com/inhabitedtype/ocaml-aws"
doc: "https://github.com/inhabitedtype/ocaml-aws"
bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues"
doc: "https://github.com/inhabitedtype/ocaml-aws"
dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git"
depends: [
"ocaml" {>= "4.08"}
Expand All @@ -28,4 +28,4 @@ depends: [
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
]
9 changes: 4 additions & 5 deletions aws-sqs.opam
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
opam-version: "2.0"
version: "1.2"
synopsis: "Amazon Web Services SDK bindings to Amazon Simple Queue Service"
description:
"Amazon Web Services SDK bindings to Amazon Simple Queue Service"
description: "Amazon Web Services SDK bindings to Amazon Simple Queue Service"
maintainer: "Tim McGilchrist <[email protected]>"
authors: [
authors: [
"Spiros Eliopoulos <[email protected]>"
"Daniel Patterson <[email protected]>"
"Tim McGilchrist <[email protected]>"
]
license: "BSD-3-clause"
homepage: "https://github.com/inhabitedtype/ocaml-aws"
doc: "https://github.com/inhabitedtype/ocaml-aws"
bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues"
doc: "https://github.com/inhabitedtype/ocaml-aws"
dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git"
depends: [
"ocaml" {>= "4.08"}
Expand All @@ -29,4 +28,4 @@ depends: [
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
]
12 changes: 5 additions & 7 deletions aws-ssm.opam
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
opam-version: "2.0"
version: "1.2"
synopsis:
"Amazon Web Services SDK bindings to Amazon Simple Systems Management Service"
description:
"Amazon Web Services SDK bindings to Amazon Simple Systems Management Service"
synopsis: "Amazon Web Services SDK bindings to Amazon Simple Systems Management Service"
description: "Amazon Web Services SDK bindings to Amazon Simple Systems Management Service"
maintainer: "Tim McGilchrist <[email protected]>"
authors: [
authors: [
"Spiros Eliopoulos <[email protected]>"
"Daniel Patterson <[email protected]>"
"Tim McGilchrist <[email protected]>"
]
license: "BSD-3-clause"
homepage: "https://github.com/inhabitedtype/ocaml-aws"
doc: "https://github.com/inhabitedtype/ocaml-aws"
bug-reports: "https://github.com/inhabitedtype/ocaml-aws/issues"
doc: "https://github.com/inhabitedtype/ocaml-aws"
dev-repo: "git+https://github.com/inhabitedtype/ocaml-aws.git"
depends: [
"ocaml" {>= "4.08"}
Expand All @@ -30,4 +28,4 @@ depends: [
build: [
["dune" "subst"] {pinned}
["dune" "build" "-p" name "-j" jobs]
]
]
Loading