Giter Club home page Giter Club logo

jumpcloud-serverless's People

Contributors

gweinjc avatar jworkmanjc avatar kmaranionjc avatar kmoorehead-jc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jumpcloud-serverless's Issues

Errors when using s3 object lock.

I'm running into errors since enabling object lock for compliance needs.

Error shown is: api error InvalidRequest: Content-MD5 OR x-amz-checksum- HTTP header is required for Put Object requests with Object Lock parameters

I imagine updating 130-134 to something like this would work:

    try:
        s3 = boto3.client('s3')

        with open("/tmp/" + outfileName, "rb") as f:
            file_content = f.read()
            md5_hash = hashlib.md5(file_content).digest()
            base64_md5 = base64.b64encode(md5_hash).decode('utf-8')

        s3.put_object(Bucket=bucketName, Key=outfileName, Body=file_content, ContentMD5=base64_md5)
    except Exception as e:
        raise Exception(e)

Error when Org Id is not provided - serverless app only runs for a single Org

Tested multiple times by providing org id to the app setup, and every time it works and generated the event logs.
When the org id is not provided, the events api always fails because it require org id to work.

So this app can only work for a single organization events backup, not for multiple orgs or MTP setup.

feature request: logstash friendly S3 log files

Hello guys,

I'm trying to read the S3 files written by the AWS Serverless Application from logstash, and I'm facing issues spanning from the fact that the files

  • are containing a JSON list as the root object
  • the JSON events are spanning multiple lines (indent=2)

So in order to read them from logstash I would have to do one of :

  • create a custom logstash input/codec or retrieve and preprocess the files before logstash using some other tool / jq etc.
  • try to leverage the multiline codec to split on some well chosen separator pattern and postprocess to reconstruct valid JSON before decode
  • try to leverage the multiline codec to read the entire files in single event and decode then split later in the pipeline

This is definitely possible but maybe not the best user experience.

Would you consider providing a second serverless app that emmits line delimited JSON (logstash friendly) in the files written in S3 ?

(so flat, no JSON list, and one event per line)

Best regards,

error while running the aws lambda funtcion

hello
i deploy the serverless app in aws
when it runs i got this error :

[ERROR] Exception: 400 Client Error: Bad Request for url: https://api.jumpcloud.com/insights/directory/v1/events
Traceback (most recent call last):
  File "/var/task/get-jcdirectoryinsights.py", line 68, in jc_directoryinsights
    raise Exception(e)

it looks like the http post to the api is not set properly
if i do curl -X POST https://api.jumpcloud.com/insights/directory/v1/events
-H 'Accept: application/json'
-H 'Content-Type: application/json'
-H 'x-api-key: api-key-here'
-d '{
"service": ["all"],
"start_time": "2021-12-14T01:00:00Z",
"end_time": "2021-12-14T18:00:00Z"
}'

it works fine

thanks for the help

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.