-
Notifications
You must be signed in to change notification settings - Fork 300
enhance: share credential #634
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
Merged
Merged
Changes from 1 commit
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 hidden or 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 hidden or 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 hidden or 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,160 @@ | ||
# This script sets up a chain of tools in a tree structure. | ||
# The root is oneOne, with children twoOne and twoTwo, with children threeOne, threeTwo, and threeThree, with only | ||
# threeTwo shared between them. | ||
# Each tool should only have access to any credentials it defines and any credentials exported/shared by its | ||
# immediate children (but not grandchildren). | ||
# This script checks to make sure that this is working properly. | ||
name: oneOne | ||
tools: twoOne, twoTwo | ||
cred: getcred with oneOne as var and 11 as val | ||
|
||
#!python3 | ||
|
||
import os | ||
|
||
oneOne = os.getenv('oneOne') | ||
twoOne = os.getenv('twoOne') | ||
twoTwo = os.getenv('twoTwo') | ||
threeOne = os.getenv('threeOne') | ||
threeTwo = os.getenv('threeTwo') | ||
threeThree = os.getenv('threeThree') | ||
|
||
if oneOne != '11': | ||
print('error: oneOne is not 11') | ||
exit(1) | ||
|
||
if twoOne != '21': | ||
print('error: twoOne is not 21') | ||
exit(1) | ||
|
||
if twoTwo != '22': | ||
print('error: twoTwo is not 22') | ||
exit(1) | ||
|
||
if threeOne is not None: | ||
print('error: threeOne is not None') | ||
exit(1) | ||
|
||
if threeTwo is not None: | ||
print('error: threeTwo is not None') | ||
exit(1) | ||
|
||
if threeThree is not None: | ||
print('error: threeThree is not None') | ||
exit(1) | ||
|
||
print('good') | ||
|
||
--- | ||
name: twoOne | ||
tools: threeOne, threeTwo | ||
exportcred: getcred with twoOne as var and 21 as val | ||
|
||
#!python3 | ||
|
||
import os | ||
|
||
oneOne = os.getenv('oneOne') | ||
twoOne = os.getenv('twoOne') | ||
twoTwo = os.getenv('twoTwo') | ||
threeOne = os.getenv('threeOne') | ||
threeTwo = os.getenv('threeTwo') | ||
threeThree = os.getenv('threeThree') | ||
|
||
if oneOne is not None: | ||
print('error: oneOne is not None') | ||
exit(1) | ||
|
||
if twoOne is not None: | ||
print('error: twoOne is not None') | ||
exit(1) | ||
|
||
if twoTwo is not None: | ||
print('error: twoTwo is not None') | ||
exit(1) | ||
|
||
if threeOne != '31': | ||
print('error: threeOne is not 31') | ||
exit(1) | ||
|
||
if threeTwo != '32': | ||
print('error: threeTwo is not 32') | ||
exit(1) | ||
|
||
if threeThree is not None: | ||
print('error: threeThree is not None') | ||
exit(1) | ||
|
||
print('good') | ||
|
||
--- | ||
name: twoTwo | ||
tools: threeTwo, threeThree | ||
exportcred: getcred with twoTwo as var and 22 as val | ||
|
||
#!python3 | ||
|
||
import os | ||
|
||
oneOne = os.getenv('oneOne') | ||
twoOne = os.getenv('twoOne') | ||
twoTwo = os.getenv('twoTwo') | ||
threeOne = os.getenv('threeOne') | ||
threeTwo = os.getenv('threeTwo') | ||
threeThree = os.getenv('threeThree') | ||
|
||
if oneOne is not None: | ||
print('error: oneOne is not None') | ||
exit(1) | ||
|
||
if twoOne is not None: | ||
print('error: twoOne is not None') | ||
exit(1) | ||
|
||
if twoTwo is not None: | ||
print('error: twoTwo is not None') | ||
exit(1) | ||
|
||
if threeOne is not None: | ||
print('error: threeOne is not None') | ||
exit(1) | ||
|
||
if threeTwo != '32': | ||
print('error: threeTwo is not 32') | ||
exit(1) | ||
|
||
if threeThree != '33': | ||
print('error: threeThree is not 33') | ||
exit(1) | ||
|
||
print('good') | ||
|
||
--- | ||
name: threeOne | ||
exportcred: getcred with threeOne as var and 31 as val | ||
|
||
--- | ||
name: threeTwo | ||
exportcred: getcred with threeTwo as var and 32 as val | ||
|
||
--- | ||
name: threeThree | ||
exportcred: getcred with threeThree as var and 33 as val | ||
|
||
--- | ||
name: getcred | ||
|
||
#!python3 | ||
|
||
import os | ||
import json | ||
|
||
var = os.getenv('var') | ||
val = os.getenv('val') | ||
|
||
output = { | ||
"env": { | ||
var: val | ||
} | ||
} | ||
print(json.dumps(output)) |
This file contains hidden or 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 hidden or 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 hidden or 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.
don't support the "export" keyword. For new things we are only adding "share" since we want everything to switch to share.
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.
fixed
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.
Well I pushed another commit at least, but it isn't showing up in the PR 🤔