Git Product home page Git Product logo

atoz's Introduction

Twitch Status Project Dashboard
nimskull prs nimskull: working nim compiler
cps prs cps: rewrites your code in continuation-passing style
insideout prs insideout: an experimental concurrency library
jade prs jade
jacl prs jacl: opencl for janet
httpleast prs httpleast: example web-server based on continuations
nimph prs nimph: sophisticated git-centric package manager
gread prs gread: genetic programming system
dist prs dist: a nim distribution for all nimions
gitnim prs gitnim: like choosenim but open and git-native
balls prs balls: a unittest framework that doesn't suck
loony prs loony: lock-free MPMC zero-copy queue for refs
trees prs trees: various tree implementations
criterion prs criterion: statistics-driven micro-benchmarking framework
npbt prs npbt: property-based testing framework
background prs background: run any function in a background thread
assume prs assume: you know what they say about assumptions
arc prs arc: atomic get/set of GC reference counters
semaphores prs semaphores: a simple concurrency primitive for counting
supervisors prs supervisors: cps dispatcher composition patterns
passenger prs passenger: a demonstration of cps dispatcher features
ups prs ups: a package handler, obviously
carnac prs carnac: magical macro that persists function results
lunacy prs lunacy: native bridge to Lua virtual machine
jason prs jason: mostly compile-time JSON encoding
mongo prs mongo: production-grade mongodb client with atlas support
redis prs redis: production-grade redis client
gram prs gram: simple in-memory graph database
frosty prs frosty: binary serialization for native types
gittyup prs gittyup: a high-level API for a low-level git library
skiplists prs skiplists: probabilistic data-structures for concurrency
bloom prs bloom: probabilistic data-structures for membership testing
badresults prs badresults: a less fascist fork of nim-result
dust: automagic minimization of compiler bugs
bump bump: a handy little tool to version and tag packages
cligen prs cligen: command-line interface generator
criterion criterion: a clever statistical micro-benchmark
sigv4 sigv4: a tiny library implementing AWS Signing V4
prs golden: build, benchmark, and discover regressions
prs gun: peer-to-peer graph database
prs openapi: turn OpenApi/Swagger JSON into native APIs
atoz: native Amazon Web Services APIs
gcplat: native Google Cloud Platform APIs
bluu: native Microsoft Azure APIs
github: native GitHub APIs
cutelog prs cutelog: simple logging replacement to annoy Zevv
gully: code comment formatter with lofty ambitions
swayipc prs swayipc: wayland compositor control via i3ipc
pulseauto prs pulseauto: control pulseaudio streams via app properties
obsdbus: plugin for OBS to provide a DBUS interface
foreach: sugary macro for validating loop variables
deebus: simple sugar over the dbus module
forecast: fairly crude but useful darksky API
wet: command-line demonstration of forecast lib
datamuse: library and query tool for datamuse API
meow: wrapper for Casey Muratori's meow hash
xs: collection of small desktop apps and tools

atoz's People

Contributors

disruptek 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

Watchers

 avatar

atoz's Issues

[FEATURE] Dynamic input of `key`, `secret` and `region`

Hi @disruptek

Currently the library uses os.getEnv("AWS_ACCESS_KEY_ID", AWS_ACCESS_KEY_ID) for multiple procs. Any specific reason for this? I would like to be able to specify the key, secret and region without accessing the environmental variables.

If that's okay with you, I can prepare a PR. Suggestions:

  • Duplicated atozSign() proc for specific values
  • Specific signing proc, atozSignGetValues(key="", secret="", region=""), which checks the params for values, otherwise returns the environmental
  • Expand current atozSign() proc's params with key="", secret="", region="" - if empty then use environmental

How to use `atoz` with `--threads:on`

Hi @disruptek

I'm testing the various API's and now I have come to testing the library within a multi threaded universe.

When enabling --threads:on the compilation fails due to gcsafe. In atoz we have many global vars, but I can manually convert them into proc's, e.g.:

var headObject* = Call_HeadObject_21626621(name: "headObject", xxxxx

But we are still relying on the rest-package with the Recallable, which also blocks the usage of --threads:on.

All of this can be "avoided" by using a {.gcsafe.}:-block - but whats the impact? Do you have an answer, or can you point me in a direction?

{.gcsafe.}:
    let request = headObject.call(%*{"Bucket": bucket, "Key": key}, query=nil, header=nil, formData=nil, body=nil)

result = await request.issueRequest()

Problems with the DynamoDB API

Hi and thanks for a great library!

I tried the SNS/SQS examples from the README file and they work fine. However, when interacting with the DynamoDB API I ran into some issues. First, I tried the following code:

import asyncdispatch, httpclient, httpcore, json
import atoz/dynamodb_20120810

let response = waitfor describeTable.call(%* {"TableName": "my-table"}).issueRequest()
echo waitfor response.body

This results in the following error: Error: unhandled exception: /home/aleksi/.nimble/pkgs/atoz-2602.0.0/atoz/dynamodb_20120810.nim(1904, 10) header != nil' header argument is necessary due to required 'X-Amz-Target' field [AssertionError]. So I went ahead and added the header:

let
  headers: JsonNode = %* {"X-Amz-Target": "DynamoDB_20120810.DescribeTable"}
  response = waitfor describeTable.call(nil, nil, headers, nil, %* {"TableName": "my-table"}).issueRequest()
echo waitfor response.body

Now the request goes through but results in a HTTP 400 response: {"__type":"com.amazon.coral.service#SerializationException"}.

Would you have any idea on what's going on here? Do we need to manually include headers or something?

I'm running atoz version 2602.0.0.

Credentials fail on Lambda due to unhandled session token

I came across another omission/bug while deploying my code to AWS Lambda. Basically the following code works locally but fails with a UnrecognizedClientException: The security token included in the request is invalid error when running on Lambda:

import asyncdispatch, atoz/dynamodb_20120810, httpclient, json

let
  body = %* { "TableName": "my-table", ... }
  response = await query.call(body).issueRequest()

Turns out Lambda uses Temporary Security Credentials which, in addition to the usual access key id and secret, includes a session token which should be added to the request as either a header or query parameter. Modifying the above example we get this piece of code that now works on Lambda as well:

let
  body = %* { "TableName": "my-table", ... }
  headers = %* {"X-Amz-Security-Token": os.getEnv("AWS_SESSION_TOKEN")}
  response = await query.call(nil, nil, headers, nil, body).issueRequest()

So I was thinking it might make sense for atoz to include the X-Amz-Security-Token header automatically if the AWS_SESSION_TOKEN env variable is defined. This is what the NodeJS and Python AWS SDKs do too, to my knowledge.

What do you think?

Dynamodb 20120810 call scan body is empty

Hi, again.

I found a possible bug in Dynamodb 20120810 scan.
When I call it, body of Recallable is empty.

  let
    path: JsonNode = nil
    query: JsonNode = nil
    header: JsonNode = nil
    formData: JsonNode = nil
    body = %* {"TableName": "ReSSt"}
    request = scan.call(path, query, header, formData, body)
    response = waitfor request.issueRequest()
  echo "payload ", request.body # is empty
  echo "status ", response.status # error 400 invalid request

The problems is that atozHook is expecting a jString but scan.call expects body as jObject

OpenAPI of AWS

Hello,

in the readme I read that this project relies heavily on the OpenAPI code generator. For that, I would assume, an openapi-yml/json definition is used. Where can I get that openapi definition? Does amazon provide one for AWS? This would help to extend this project by missing services.

files stored in git LFS

It looks like all the .nim files in src are being stored in large file format, which means nimble install doesn't work and neither does cloning the repo.

None of the files look like they're big enough to require that, so I'm not sure what happened.

S3 putObject requires JsonNode (JObject) for body instead of file

the documentation for the putObject method against the S3 endpoint shows that files, which should be uploaded to S3, need to be placed plain as body in the PUT-request and not a json:
http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectPUT.html

But the implementation asks for JsonNode (of JObject to be concrete) instead of file, which results in empty files in AWS S3. I know what I need to change to get it working, but the code is automatically generated, right? So adding it via a pull request wouldn't be helpful.

Assuming my code looks like the following:

var fileContent =readAll(filename.open)
var fileAsJObject = newJObject()
fileAsJObject.add(key="file",val=newJString(fileContent))

var resp = putObject.call(Bucket="order", Key="customerXYZ/pizza.txt", body=fileAsJObject).retried

then my workaround in s3_20060301 is the following:

  • change line 8660: result.add "body", body
  • to: result.add "body", body.getOrDefault(key="file")

The cleaner way would be of course to pass a file directly, but I don't see on which base the nim code will be generated.

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.