-
Notifications
You must be signed in to change notification settings - Fork 176
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9144 from 2403905/issue-9067
Added the watermark text for the Secure View mode
- Loading branch information
Showing
3 changed files
with
88 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Enhancement: Add watermark text | ||
|
||
We've added the watermark text for the Secure View mode. | ||
|
||
https://github.com/owncloud/ocis/pull/9144 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,9 @@ var _ = Describe("FileConnector", func() { | |
OpaqueId: "opaqueId", | ||
Type: userv1beta1.UserType_USER_TYPE_PRIMARY, | ||
}, | ||
Username: "Pet Shaft", | ||
Username: "Shaft", | ||
DisplayName: "Pet Shaft", | ||
Mail: "[email protected]", | ||
// Opaque is here for reference, not used by default but might be needed for some tests | ||
//Opaque: &typesv1beta1.Opaque{ | ||
// Map: map[string]*typesv1beta1.OpaqueEntry{ | ||
|
@@ -871,5 +873,56 @@ var _ = Describe("FileConnector", func() { | |
Expect(err).To(Succeed()) | ||
Expect(newFileInfo).To(Equal(expectedFileInfo)) | ||
}) | ||
|
||
It("Stat success authenticated user", func() { | ||
// change view mode to view only | ||
wopiCtx.ViewMode = appproviderv1beta1.ViewMode_VIEW_MODE_VIEW_ONLY | ||
|
||
ctx := middleware.WopiContextToCtx(context.Background(), wopiCtx) | ||
|
||
gatewayClient.On("Stat", mock.Anything, mock.Anything).Times(1).Return(&providerv1beta1.StatResponse{ | ||
Status: status.NewOK(ctx), | ||
Info: &providerv1beta1.ResourceInfo{ | ||
Owner: &userv1beta1.UserId{ | ||
Idp: "customIdp", | ||
OpaqueId: "aabbcc", | ||
Type: userv1beta1.UserType_USER_TYPE_PRIMARY, | ||
}, | ||
Size: uint64(998877), | ||
Mtime: &typesv1beta1.Timestamp{ | ||
Seconds: uint64(16273849), | ||
}, | ||
Path: "/path/to/test.txt", | ||
// Other properties aren't used for now. | ||
}, | ||
}, nil) | ||
|
||
expectedFileInfo := connector.FileInfo{ | ||
OwnerId: "61616262636340637573746f6d496470", // hex of aabbcc@customIdp | ||
Size: int64(998877), | ||
Version: "16273849.0", | ||
BaseFileName: "test.txt", | ||
BreadcrumbDocName: "test.txt", | ||
UserCanNotWriteRelative: true, | ||
HostViewUrl: "http://test.ex.prv/view", | ||
HostEditUrl: "http://test.ex.prv/edit", | ||
EnableOwnerTermination: false, | ||
SupportsExtendedLockLength: true, | ||
SupportsGetLock: true, | ||
SupportsLocks: true, | ||
DisableExport: true, | ||
DisableCopy: true, | ||
DisablePrint: true, | ||
IsAnonymousUser: false, | ||
UserId: hex.EncodeToString([]byte("opaqueId@inmemory")), | ||
UserFriendlyName: "Pet Shaft", | ||
WatermarkText: "Pet Shaft [email protected]", | ||
} | ||
|
||
newFileInfo, err := fc.CheckFileInfo(ctx) | ||
|
||
Expect(err).To(Succeed()) | ||
Expect(newFileInfo).To(Equal(expectedFileInfo)) | ||
}) | ||
}) | ||
}) |