Skip to content
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

uplinkc: add restrict_scope function #3724

Merged
merged 7 commits into from
Dec 17, 2019
Merged

Conversation

mniewrzal
Copy link
Contributor

@mniewrzal mniewrzal commented Dec 11, 2019

What: New function restrict_scope to restrict access to resources with caveat and encryption restriction. The function returns new scope with restricted api key and encryption access.

Why: We want to expose ability to restrict resource in uplinkc

based on #3705

Please describe the tests:

  • Test 1: basic unit test added

Please describe the performance impact: none

Code Review Checklist (to be filled out by reviewer)

  • NEW: Are there any Satellite database migrations? Are they forwards and backwards compatible?
  • Does the PR describe what changes are being made?
  • Does the PR describe why the changes are being made?
  • Does the code follow our style guide?
  • Does the code follow our testing guide?
  • Is the PR appropriately sized? (If it could be broken into smaller PRs it should be)
  • Does the new code have enough tests? (every PR should have tests or justification otherwise. Bug-fix PRs especially)
  • Does the new code have enough documentation that answers "how do I use it?" and "what does it do?"? (both source documentation and higher level, diagrams?)
  • Does any documentation need updating?
  • Do the database access patterns make sense?

@cla-bot cla-bot bot added the cla-signed label Dec 11, 2019
@mniewrzal mniewrzal added Request Code Review Code review requested Reviewer Can Merge If all checks have passed, non-owner can merge PR labels Dec 11, 2019
@mniewrzal mniewrzal marked this pull request as ready for review December 11, 2019 13:21
@mniewrzal mniewrzal requested a review from a team December 11, 2019 13:21
@ghost ghost requested review from Fadila82 and wthorp and removed request for a team December 11, 2019 13:21
@TopperDEL
Copy link
Contributor

Merge it! :)

@ifraixedes ifraixedes self-requested a review December 12, 2019 11:05
@ifraixedes ifraixedes self-requested a review December 13, 2019 14:05
ifraixedes
ifraixedes previously approved these changes Dec 13, 2019
lib/uplinkc/access_scope.go Outdated Show resolved Hide resolved
printf("failed:\n\t%s:%d: %s\n", __FILE__, __LINE__, err);\
exit(1);\
}\
} while (0)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, what while(0) does here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh don't know, maybe @bryanchriswhite will explain

@mniewrzal mniewrzal merged commit 0e12c23 into master Dec 17, 2019
@mniewrzal mniewrzal deleted the mn/uplinkc-restrict-scope branch December 17, 2019 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed Request Code Review Code review requested Reviewer Can Merge If all checks have passed, non-owner can merge PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants