-
Notifications
You must be signed in to change notification settings - Fork 0
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
Feature/add auth spec #216
Open
nsoblath
wants to merge
2
commits into
feature/dlpy5
Choose a base branch
from
feature/add-auth-spec
base: feature/dlpy5
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
services: | ||
|
||
# The broker for the mesh | ||
rabbit-broker: | ||
image: rabbitmq:3-management | ||
ports: | ||
- "15672:15672" | ||
environment: | ||
- RABBITMQ_DEFAULT_USER=dripline | ||
- RABBITMQ_DEFAULT_PASS=dripline | ||
healthcheck: | ||
test: ["CMD-SHELL", "curl -u dripline:dripline http://rabbit-broker:15672/api/overview &> /dev/null || exit 1"] | ||
|
||
# The classic key-value store, a configuration based on the base Service class | ||
key-value-store: | ||
image: ghcr.io/project8/dragonfly:${DGFLY_IMG_TAG:-latest-dev} | ||
depends_on: | ||
rabbit-broker: | ||
condition: service_healthy | ||
volumes: | ||
- ./examples/key-value-store.yaml:/root/key-value-store.yaml | ||
- ./dripline_mesh.yaml:/root/.dripline_mesh.yaml | ||
environment: | ||
- DRIPLINE_USER=dripline | ||
- DRIPLINE_PASSWORD=dripline | ||
command: > | ||
bash -c "dl-serve -vv -c /root/key-value-store.yaml" | ||
|
||
# The classic key-value-store service with a jitter endpoint | ||
jitter: | ||
image: ghcr.io/project8/dragonfly:${DGFLY_IMG_TAG:-latest-dev} | ||
depends_on: | ||
rabbit-broker: | ||
condition: service_healthy | ||
volumes: | ||
- ./examples/jitter_example.yaml:/root/jitter_example.yaml | ||
- ./dripline_mesh.yaml:/root/.dripline_mesh.yaml | ||
environment: | ||
- DRIPLINE_USER=dripline | ||
- DRIPLINE_PASSWORD=dripline | ||
command: > | ||
bash -c "dl-serve -vv -c /root/jitter_example.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import logging | ||
logger = logging.getLogger(__name__) | ||
|
||
def __get_version(): | ||
import scarab | ||
import dragonfly | ||
import pkg_resources | ||
#TODO: this all needs to be populated from setup.py and gita | ||
version = scarab.VersionSemantic() | ||
logger.info('version should be: {}'.format(pkg_resources.get_distribution('dragonfly').version)) | ||
version.parse(pkg_resources.get_distribution('dragonfly').version) | ||
version.package = 'project8/dragonfly' | ||
version.commit = 'na' | ||
dragonfly.core.add_version('dragonfly', version) | ||
return version | ||
version = __get_version() | ||
__version__ = version.version |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,9 @@ | ||
__all__ = [] | ||
|
||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) | ||
|
||
# Subdirectories | ||
from . import jitter | ||
# add further subdirectories here | ||
|
||
import logging | ||
logger = logging.getLogger(__name__) | ||
|
||
def __get_version(): | ||
import scarab | ||
import dragonfly | ||
import pkg_resources | ||
#TODO: this all needs to be populated from setup.py and gita | ||
version = scarab.VersionSemantic() | ||
logger.info('version should be: {}'.format(pkg_resources.get_distribution('dragonfly').version)) | ||
version.parse(pkg_resources.get_distribution('dragonfly').version) | ||
version.package = 'project8/dragonfly' | ||
version.commit = 'na' | ||
dragonfly.core.add_version('dragonfly', version) | ||
return version | ||
version = __get_version() | ||
# Modules in this directory | ||
from .add_auth_spec import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
''' | ||
Contains the AddAuthSpec class, for adding authentication specifications | ||
''' | ||
|
||
import dripline.implementations | ||
import scarab | ||
|
||
import logging | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
__all__ = [] | ||
|
||
__all__.append('AddAuthSpec') | ||
class AddAuthSpec(dripline.implementations.BaseAddAuthSpec): | ||
''' | ||
|
||
''' | ||
|
||
def __init__(self, app): | ||
''' | ||
''' | ||
dripline.implementations.BaseAddAuthSpec.__init__(self, app) | ||
self.add_slack_auth_spec(app) | ||
|
||
def add_slack_auth_spec(self, app): | ||
''' | ||
Adds the Slack authenticaiton specification to a scarab::main_app object | ||
''' | ||
auth_spec = { | ||
'dripline': { | ||
'default': 'default-token', | ||
'env': 'DRIPLINE_SLACK_TOKEN', | ||
}, | ||
} | ||
app.add_default_auth_spec_group( 'slack', scarab.to_param(auth_spec).as_node() ) | ||
logging.debug('Added slack auth spec') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
broker: rabbit-broker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name: my_store | ||
name: jitter-store | ||
module: Service | ||
endpoints: | ||
- name: peaches | ||
- name: jitter-peaches | ||
module: JitterEntity | ||
calibration: '2*{}' | ||
initial_value: 0.75 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: my_store | ||
module: Service | ||
endpoints: | ||
- name: peaches | ||
module: KeyValueStore | ||
calibration: '2*{}' | ||
initial_value: 0.75 | ||
log_interval: 10 | ||
get_on_set: True | ||
log_on_set: True | ||
- name: chips | ||
module: KeyValueStore | ||
calibration: 'times3({})' | ||
initial_value: 1.75 | ||
- name: waffles | ||
module: KeyValueStore | ||
#log_interval: 30 | ||
#log_on_set: True | ||
calibration: '1.*{}' | ||
initial_value: 4.00 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ultimately I think we may want to revisit the directory naming convention for clarity, but not an issue for this PR. And requires unification across multiple repos.