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

Fix a lot of things about sharing #1130

Merged
merged 12 commits into from
Jan 2, 2018
Merged

Fix a lot of things about sharing #1130

merged 12 commits into from
Jan 2, 2018

Conversation

nono
Copy link
Member

@nono nono commented Dec 27, 2017

No description provided.

@codecov-io
Copy link

codecov-io commented Dec 28, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@5e936a3). Click here to learn what that means.
The diff coverage is 39.76%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1130   +/-   ##
=========================================
  Coverage          ?   85.17%           
=========================================
  Files             ?      175           
  Lines             ?    52193           
  Branches          ?        0           
=========================================
  Hits              ?    44456           
  Misses            ?     6305           
  Partials          ?     1432
Impacted Files Coverage Δ
pkg/sharings/member.go 72.28% <ø> (ø)
pkg/workers/sharings/sharing_updates.go 25.54% <0%> (ø)
web/sharings/sharings.go 70% <0%> (ø)
pkg/sharings/workflow.go 23.97% <0%> (ø)
web/auth/auth.go 60.03% <0%> (ø)
pkg/sharings/sharings.go 78.89% <100%> (ø)
pkg/sharings/revoke.go 62.79% <45.45%> (ø)
pkg/workers/mails/mail_templates.go 93.57% <50%> (ø)
web/permissions/permissions.go 73% <50%> (ø)
pkg/permissions/permissions.go 72.07% <57.14%> (ø)
... and 2 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 5e936a3...b7b2a35. Read the comment docs.

Copy link
Contributor

@enguerran enguerran left a comment

Choose a reason for hiding this comment

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

There is a lot of code duplication

if perm.Expired() {
    return nil, ErrExpiredToken
}
return perm, nil

Permissions Set `json:"permissions,omitempty"`

// XXX omitempty does not work for time.Time, thus the interface{} type
ExpiresAt interface{} `json:"expires_at,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not using a *time.Time ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good question. I have copied what was done here: https://github.com/cozy/cozy-stack/blob/master/pkg/oauth/client.go#L63

@nono nono merged commit 980b057 into cozy:master Jan 2, 2018
@nono nono deleted the sharings-revoke branch January 2, 2018 13:12
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.

5 participants