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

feat(auth): Add the workflow's creator as a label. Closes #2437 #2488

Closed
wants to merge 4 commits into from

Conversation

alexec
Copy link
Contributor

@alexec alexec commented Mar 20, 2020

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this is a chore.
  • The title of the PR is (a) conventional, (b) states what changed, and (c) suffixes the related issues number. E.g. "fix(controller): Updates such and such. Fixes #1234".
  • I have written unit and/or e2e tests for my change. PRs without these are unlike to be merged.
  • Optional. I've added My organization is added to the USERS.md.
  • I've signed the CLA and required builds are green.

@@ -61,5 +71,5 @@ func GetAuthString() string {
if err != nil {
log.Fatal(err)
}
return authString
return fmt.Sprintf("v2/%s/%s", authString, GetUser().Name)
Copy link
Contributor Author

@alexec alexec Mar 20, 2020

Choose a reason for hiding this comment

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

this creates strange looking, but valid tokens:

  • v2/Bearer 34534==/alex

</p>
)}
<p>
<i className='fa fa-info-circle' /> You appear to be <b> logged {maybeLoggedIn() ? 'in as ' + this.username : 'out'}</b>. It may not be necessary to login
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is really for debugging purposes

@codecov
Copy link

codecov bot commented Mar 20, 2020

Codecov Report

Merging #2488 into master will increase coverage by 0.07%.
The diff coverage is 13.98%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2488      +/-   ##
==========================================
+ Coverage   11.22%   11.30%   +0.07%     
==========================================
  Files          83       75       -8     
  Lines       32696    31248    -1448     
==========================================
- Hits         3671     3533     -138     
+ Misses      28525    27244    -1281     
+ Partials      500      471      -29     
Impacted Files Coverage Δ
cmd/argo/commands/server.go 0.00% <0.00%> (ø)
...kg/apis/workflow/v1alpha1/zz_generated.deepcopy.go 0.00% <0.00%> (ø)
util/resource/labeler.go 0.00% <0.00%> (ø)
pkg/apis/workflow/v1alpha1/generated.pb.go 0.46% <0.78%> (-0.01%) ⬇️
server/auth/gatekeeper.go 25.97% <29.62%> (-0.90%) ⬇️
server/cronworkflow/cron_workflow_server.go 52.94% <100.00%> (+0.37%) ⬆️
server/workflow/workflow_server.go 36.44% <100.00%> (+0.60%) ⬆️
...erver/workflowtemplate/workflow_template_server.go 56.60% <100.00%> (+1.88%) ⬆️
util/archive/archive.go 57.50% <0.00%> (-4.70%) ⬇️
workflow/controller/dag.go 51.09% <0.00%> (-4.03%) ⬇️
... and 46 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf277eb...62250ad. Read the comment docs.

@alexec
Copy link
Contributor Author

alexec commented Mar 20, 2020

@jessesuen before I ask for reviews - can I check with you on whether or not this is the correct direction philosopically?

@alexec alexec linked an issue Mar 20, 2020 that may be closed by this pull request
@alexec alexec closed this Mar 23, 2020
@alexec alexec deleted the creator branch March 23, 2020 21:05
@alexec alexec restored the creator branch April 10, 2020 23:52
@alexec alexec reopened this Apr 10, 2020
@sonarcloud
Copy link

sonarcloud bot commented Apr 11, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

No Coverage information No Coverage information
3.9% 3.9% Duplication

header := getHeader(md, "authorization")
if strings.HasPrefix(header, "v2/") {
parts := strings.SplitN(header, "/", 3)
return parts[1], wfv1.User{Name: parts[2]}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

malformed token would panic

@alexec alexec closed this Apr 13, 2020
@alexec alexec deleted the creator branch July 1, 2020 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search for workflows by creator
1 participant