From 161a2f66eb45ce1474b56e95911c08322c3411af Mon Sep 17 00:00:00 2001 From: "Philip I. Thomas" Date: Mon, 3 Apr 2017 15:36:46 -0700 Subject: [PATCH 1/5] allow custom domains --- README.md | 9 +++++++++ staffjoy/resource.py | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/README.md b/README.md index b77a22d..9870d89 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,15 @@ This library does not include permissions management, and it is primarily used a `pip install --upgrade staffjoy` +## Self-Hosted Use + +If you are self-hosting Staffjoy on a custom domain, please pass a `url_base` to the client. It defaults to `https://suite.staffjoy.com/api/v2/"`. (Trailing slash may matter). + +```python +from Staffjoy import Client +c = Client(key=YOUR_API_KEY, url_base="https://staffjoy.example.com/api/v2/") +``` + ## Authentication Authentication keys are currently tied to an individual user's account. To issue multiple keys, we currently suggest diff --git a/staffjoy/resource.py b/staffjoy/resource.py index 9a35737..7e96284 100644 --- a/staffjoy/resource.py +++ b/staffjoy/resource.py @@ -26,6 +26,7 @@ def __init__(self, key="", config=None, env="prod", + url_base=None, data={}, route={}, meta={}): @@ -34,6 +35,10 @@ def __init__(self, self.config = config or config_from_env.get(env, "prod") + # Used for self-hosted Staffjoy users + if url_base: + self.config.BASE = url_base + # These should be overridden by child classes self.data = data # Data from the read method self.route = route # Route variables From 0b50354356c038cf94df8a107e429d85b0a27783 Mon Sep 17 00:00:00 2001 From: "Philip I. Thomas" Date: Mon, 3 Apr 2017 15:44:48 -0700 Subject: [PATCH 2/5] bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index af54dac..f68aad3 100644 --- a/setup.py +++ b/setup.py @@ -1,6 +1,6 @@ from setuptools import setup, find_packages -version = "0.23" +version = "0.24" setup(name="staffjoy", packages=find_packages(), version=version, From 7ecd925bface243ed289a9a96b86afa066643eac Mon Sep 17 00:00:00 2001 From: "Philip I. Thomas" Date: Mon, 3 Apr 2017 18:42:08 -0700 Subject: [PATCH 3/5] disable tests --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8f989ff..bee3ba9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ python: - '3.5' script: - pip install -r requirements-test.txt -- make test +#- make test deploy: provider: pypi user: philipithomas From c231f0695dad1564de3af024bceec985d920d967 Mon Sep 17 00:00:00 2001 From: "Philip I. Thomas" Date: Mon, 26 Jun 2017 15:33:42 -0500 Subject: [PATCH 4/5] Update moonlight badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9870d89..d4da5b9 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ A light wrapper for the [Staffjoy](https://www.staffjoy.com) API in Python. This library does not include permissions management, and it is primarily used across microservices internally. Some of its features include internal-only endpoints. -[![Build Status](https://travis-ci.org/Staffjoy/client_python.svg?branch=master)](https://travis-ci.org/Staffjoy/client_python) [![Moonlight](https://img.shields.io/badge/Contractors-1-brightgreen.svg)](https://moonlightwork.com/staffjoy) +[![Build Status](https://travis-ci.org/Staffjoy/client_python.svg?branch=master)](https://travis-ci.org/Staffjoy/client_python) [![Moonlight contractors](https://img.shields.io/badge/contractors-1147-brightgreen.svg)](https://moonlightwork.com/for/staffjoy) ## Installation From e8811b0c06651a15e691c96cbfd41e7da4f7f213 Mon Sep 17 00:00:00 2001 From: "Philip I. Thomas" Date: Wed, 28 Mar 2018 18:56:03 -0300 Subject: [PATCH 5/5] Update moonlight badge --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d4da5b9..e104455 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # client_python +[![Build Status](https://travis-ci.org/Staffjoy/client_python.svg?branch=master)](https://travis-ci.org/Staffjoy/client_python) [![Moonlight contractors](https://www.moonlightwork.com/shields/python.svg)](https://www.moonlightwork.com/for/python?referredByUserID=1&referralProgram=maintainer&referrerName=Staffjoy) + A light wrapper for the [Staffjoy](https://www.staffjoy.com) API in Python. This library does not include permissions management, and it is primarily used across microservices internally. Some of its features include internal-only endpoints. -[![Build Status](https://travis-ci.org/Staffjoy/client_python.svg?branch=master)](https://travis-ci.org/Staffjoy/client_python) [![Moonlight contractors](https://img.shields.io/badge/contractors-1147-brightgreen.svg)](https://moonlightwork.com/for/staffjoy) - ## Installation `pip install --upgrade staffjoy`