Whitelisting jwt and enabling decryption of whitelisted addons#418
Whitelisting jwt and enabling decryption of whitelisted addons#418sebv wants to merge 2 commits intotravis-ci:masterfrom
Conversation
|
@joshk looks like this will do the job for us from a travis-core perspective. Let us know if you have questions. Thanks! |
lib/travis/model/job.rb
Outdated
There was a problem hiding this comment.
Can we stay away from postfix conditionals? Makes the logic harder to follow.
There was a problem hiding this comment.
I was following the pattern of lines 123 and 124. I don't mind to change but probably should be a global thing.
There was a problem hiding this comment.
That's a good point. I thought about this a bit more, and I think the difficulty (for me) comes from using the same conditional twice in postfix: X if A && B; Y if A. The previous structure seems better to me.
There was a problem hiding this comment.
The config has changed between the 2, it's not actually the same condition.
There was a problem hiding this comment.
@BanzaiMan if you want to clean it up, you need to move if config[:addons] to the delete_addons method.
I tried to do that, but it triggers an issue in the specs when :source is null. Wasn't sure about the best way to fix that (not a ruby programmer).
There was a problem hiding this comment.
@BanzaiMan thoughts? Do you think this is good enough to merge? We can go ahead to modify delete-addons if you think that's the only way to go, but would prefer to avoid that if you think there are other options.
There was a problem hiding this comment.
I agree with Hiro that the previous structure was better.
I find this bit of code a little hard to follow sorry.
There was a problem hiding this comment.
@santiycr @sebv Could you rework this part of logical flow before I merge this? A more straightforward
if config[:addons]
if addons_enabled?
config[:addons] = decrypt_addons(config[:addons])
else
delete_addons(config)
config[:addons] = decrypt_addons(config[:addons])
end
endseems more readable to me, even though config[:addons] = … appears twice in the if statement.
There was a problem hiding this comment.
Further thought… Do we really want all other whitelisted addons to decrypt the configurations when addons_enabled? is falsey?
There was a problem hiding this comment.
@BanzaiMan
If i'm reading it correctly, addons_enabled? is falsey if its a pull request.
If we want to update this check to only decrypt the jwt token on PRs, then we need a new list of decryptable whitelisted plugins?
That seems like the safest solution.
|
@joshk I've just rebased everything, would it be possible to work on merging beginning of Jan. |
Whitelisting jwt and enabling decryption of whitelisted addons
|
ping @Josk @BanzaiMan. Would be good to get this done, users are waiting: |
|
@BanzaiMan just rebased. |
|
hey @BanzaiMan this would be amazing to get in, over on https://github.com/tastejs/todomvc we would loveeeee to have this :) |
|
Thank you! I will take a look soon. :-D |
|
The team is in town next week. I'll make sure we have a chance to chat about the PR :) |
Hopefully will be resolved by travis-ci/travis-core#418
Hopefully will be resolved by travis-ci/travis-core#418
Hopefully will be resolved by travis-ci/travis-core#418
|
👋 @joshk wondering if you had any feedback from your team meetings? |
Hopefully will be resolved by travis-ci/travis-core#418
|
Am also interested to know if this is likely to land soon. |
|
Wondering if I should wait for this to land in Travis production? Or roll out a solution like https://github.com/cvrebert/savage ? Any timeline estimates @joshk ? |
|
This (along with travis-ci/travis-build#356) has been deployed to staging. My limited test seems reasonable (works as far as I can tell), and I would like to have a larger set of users test it. To use this in staging, follow the following steps:
The staging environment may be used for other tests, so if you suspect it's not working, please check with me if the correct code is deployed. |
|
Hi @BanzaiMan my orgs are currently not showing up on the staging server the Looking forward to testing this out on TodoMVC, thanks again for the merge on this |
|
@samccone Which organization is not showing up? On staging, I see that you have access to "twosigma" and "tastejs" organizations. |
|
Tastejs. Want me to try again? |
|
@samccone Do you see anything in https://staging.travis-ci.org/profile/tastejs? (Staging is currently used for testing another PR, so JWT addon does not work.) |
|
Shows up now! 👪 ping me when I can try again 💏. Excited to land this |
|
Hi @BanzaiMan - I'm late to the party here, but just wondering if the use case of running a SauceLabs Pull Request build with secure env variables is a working use case now? The docs here say otherwise: http://docs.travis-ci.com/user/pull-requests/#Security-Restrictions-when-testing-Pull-Requests |
Hopefully will be resolved by travis-ci/travis-core#418
|
@BanzaiMan I've rebased both patches so they should now work against master again Also added a new list of addons that are safe to decrypt since thats what one of the comments mentioned. Let me know if there's anything else. |
See: travis-ci/travis-build#356 travis-ci/travis-core#418 sebv/jwt-doc#5 For some historic context
See: travis-ci/travis-build#356 travis-ci/travis-core#418 sebv/jwt-doc#5 For some historic context
See: travis-ci/travis-build#356 travis-ci/travis-core#418 sebv/jwt-doc#5 For some historic context



Core changes required for the JWT token PR.