-
Notifications
You must be signed in to change notification settings - Fork 161
Assembla Deep Integration: Travis API Endpoint #1380
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
Assembla Deep Integration: Travis API Endpoint #1380
Conversation
Let's re-review it after the changes requested are made. |
halt 403, { error: 'Deep integration not enabled' } unless deep_integration_enabled? | ||
halt 403, { error: 'Invalid ASM cluster' } unless valid_asm_cluster? | ||
@jwt_payload = verify_jwt(request) | ||
check_required_fields | ||
end | ||
|
||
def check_required_fields | ||
missing = REQUIRED_JWT_FIELDS.select { |f| @jwt_payload[f].nil? || @jwt_payload[f].to_s.strip.empty? } | ||
unless missing.empty? | ||
halt 400, { error: 'Missing required fields', missing: missing } |
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.
Maybe create a config and add all error messages to that so it is easy to see all errors this integration can generate and then use that config where you are raising the error.
@piccadilly-circus @murtaza-swati Need this PR to be reviewed again as couple of changes made that came up during testing |
Sync only passed space and repository
21c3d1a
into
prd-asm_integration_dev
Summary
This PR adds a JWT-protected
/assembla/login
endpoint to Travis API for seamless Assembla user onboarding and sync.**Endpoint Parameters **
It accepts id, name, email, login, space_id, access_token, refresh_token as protected JWT parameters and returns
{ user_id: USER_ID, login: USER_LOGIN, token: USER_TOKEN, status: SIGNIN_STATUS }
Setup
To use this integration, set the following environment variables in your Travis API environment:
ASSEMBLA_JWT_SECRET
- Shared secret for JWT validation.ASSEMBLA_CLUSTERS
- Comma-separated list of allowed Assembla clusters.DEEP_INTEGRATION_ENABLED
- Set to true to enable the integration.