Giter Site home page Giter Site logo

oktalib's Introduction

oktalib

A python library for interfacing with OKTA's api

Development Workflow

The workflow supports the following steps

  • lint
  • test
  • build
  • document
  • upload
  • graph

These actions are supported out of the box by the corresponding scripts under _CI/scripts directory with sane defaults based on best practices. Sourcing setup_aliases.ps1 for windows powershell or setup_aliases.sh in bash on Mac or Linux will provide with handy aliases for the shell of all those commands prepended with an underscore.

The bootstrap script creates a .venv directory inside the project directory hosting the virtual environment. It uses pipenv for that. It is called by all other scripts before they do anything. So one could simple start by calling _lint and that would set up everything before it tried to actually lint the project

Once the code is ready to be delivered the _tag script should be called accepting one of three arguments, patch, minor, major following the semantic versioning scheme. So for the initial delivery one would call

$ _tag --minor

which would bump the version of the project to 0.1.0 tag it in git and do a push and also ask for the change and automagically update HISTORY.rst with the version and the change provided.

So the full workflow after git is initialized is:

  • repeat as necessary (of course it could be test - code - lint :) ) * code * lint * test
  • commit and push
  • develop more through the code-lint-test cycle
  • tag (with the appropriate argument)
  • build
  • upload (if you want to host your package in pypi)
  • document (of course this could be run at any point)

Important Information

This template is based on pipenv. In order to be compatible with requirements.txt so the actual created package can be used by any part of the existing python ecosystem some hacks were needed. So when building a package out of this do not simple call

$ python setup.py sdist

as this will produce an unusable artifact with files missing. Instead use the provided build and upload scripts that create all the necessary files in the artifact.

Project Features

  • Manages groups, users and applications.

Todo

Extend with more functionality as required...

oktalib's People

Contributors

abelmokadem avatar costastf avatar dependabot[bot] avatar dogfish182 avatar lttmtins avatar sayantankhanra10 avatar yhoorneman avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

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

oktalib's Issues

Trouble with pagination

While querying the /api/v1/apps endpoint, Okta is returning continuation links with limit parameters already applied, e.g. https://okta.com/api/v1/apps?after=0oa1g2o8sr2hhAGBh0h8&limit=100

That's generating an error for me when oktalib tries to GET it while also supplying the limit as an additional parameter. It works fine as long as I make sure that the limit parameter is only provided once.

Here's the error I get:

{'errorCode': 'E0000037', 'errorSummary': "Type mismatch exception. Could not convert parameter 'limit' to the required type.", 'errorLink': 'E0000037', 'errorId': 'oaeAbUMna8vR_qMMx4xZ5iGyw', 'errorCauses': []}

I'm using a quick and dirty fix in Okta._get_paginated_url that looks like this:

            while next_link:
                if "&limit=" in next_link:
                    response = self.session.get(url=next_link)
                else:
                    response = self.session.get(url=next_link, params=params)
                results.extend(response.json())

Which seems to work as expected, but could be more correct if it actually parsed out the query string.

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.