-
Notifications
You must be signed in to change notification settings - Fork 35
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
Multi profiles #19
Open
pdenning
wants to merge
19
commits into
StackStorm-Exchange:master
Choose a base branch
from
pdenning:multi-profiles
base: master
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
Multi profiles #19
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
da7273a
adding multi Jira profiles
paul-denning a0c8d49
fixed issues with default profile
paul-denning 536e08d
Added profiles to all actions
paul-denning e382643
added profile section to readme and add changes to changes.md and bum…
paul-denning 272123e
fixed readme
paul-denning 6d7bff3
fixed whitespace issue
paul-denning 4a85140
fixed readme
paul-denning b4c5803
fixed whitepsaces on blank lines
Ragnra 3078b85
fixed liniting
Ragnra bda1233
fixed up example to include new config options
Ragnra 3a6897e
removed unrequired second config example file
Ragnra 5ef48cb
suggest changes from pull request
paul-denning 21886d6
Merge pull request #1 from pdenning/multi-profiles-pr
pdenning d89c994
Fixed issues
paul-denning 36ca67e
Fixed liniting issues
paul-denning 680b306
Merge pull request #2 from pdenning/master
pdenning 84193f6
fixed rebase issues
paul-denning 96301b0
aligned config example with actual config issues?
paul-denning cc14c71
Merge branch 'master' into multi-profiles
paul-denning 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
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
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
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
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
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
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
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
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
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
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
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,10 +1,29 @@ | ||
--- | ||
url: "https://company.atlassian.net" | ||
rsa_cert_file: "/home/vagrant/jira.pem" | ||
auth_method: "oauth" | ||
oauth_token: "" | ||
oauth_secret: "" | ||
consumer_key: "" | ||
poll_interval: 30 | ||
project: "MY_PROJECT" | ||
verify: True | ||
url: "https://company.atlassian.net" | ||
rsa_cert_file: "/home/vagrant/jira.pem" | ||
auth_method: "oauth" | ||
oauth_token: "" | ||
oauth_secret: "" | ||
consumer_key: "" | ||
poll_interval: 30 | ||
project: "MY_PROJECT" | ||
verify: True | ||
default_profile: "dev" | ||
profiles: | ||
- name: "dev" | ||
pdenning marked this conversation as resolved.
Show resolved
Hide resolved
|
||
url: "https://dev.atlassian.net" | ||
rsa_cert_file: "/home/vagrant/jira.pem" | ||
auth_method: "basic" | ||
username: "dev-user" | ||
password: "mypas" | ||
project: "MY_PROJECT" | ||
verify: True | ||
- name: "prod" | ||
url: "https://prod.atlassian.net" | ||
rsa_cert_file: "/home/vagrant/jira.pem" | ||
auth_method: "oauth" | ||
oauth_token: "" | ||
oauth_secret: "" | ||
consumer_key: "" | ||
project: "MY_PROJECT" | ||
verify: True |
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.
Using an array of profile dictionaries:
is kind of clunky. Using a dictionary of profile dictionaries would be cleaner:
Using a dictionary also means that you don't have to specify a
default_profile
- the inline values function as the default profile values.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.
Agreed, I looked into this, but i wasn't sure how to define a dynamic key within the config schema file.
Could you point me in the right direction on how to define that and i'll look into changing it
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.
Oh gotcha. Dictionaries are called "objects" in JSONSchema.
My review comment later on contains a good example of what you can/should do. All you should need to do is:
<<: &root_anchor
after the---
line, before all of the existing keysprofiles
key from my example intoconfig.schema.yaml
Let me know if you have any further questions - this is easily the most confusing part of a pack.
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.
I saw your example below, i did implement it. However it appears there is a bug.
If i try and use an encrypted key store, it ignores the secret value and doesn't decrypt the password.
This happens when using anchors or not.
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.
I have merged my changes. However there still appears to be a bug with secret key values. Maybe i am missing something you'll noticed
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.
Does
st2kv.system.jira_prod_pass
get decrypted?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.
@blag
Yes the jira_prod_pass gets decrypted, however jira_dev_pass doesnt.
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.
@pdenning Sorry I don't have more to update, but at this point I believe this isn't working due to an undiscovered bug in StackStorm. I haven't had time to reproduce the issue or add a similar config to StackStorm's test fixtures yet, but I haven't forgotten about it.
If you managed to get it working, then please resolve this conversation, but if not I'd like to fix the bug in StackStorm itself (st2 repo) before we merge this PR.
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.
I found the bug. In order to decrypt the key, the schema needs to declare
secret: true
, BUT, the config loader does not look at any schemas underadditionalProperties
, so theprofiles
object is effectively schema-less:https://github.com/StackStorm/st2/blob/8496bb2407b969f0937431992172b98b545f6756/st2common/st2common/util/config_loader.py#L133-L137
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.
I'm working on a fix for this here: StackStorm/st2#5225