githaven/models/fixtures/attachment.yml
Antoine GIRARD 8b24073713 Only serve attachments when linked to issue/release and if accessible by user (#9340)
* test: add current attachement responses

* refactor: check if attachement is linked and accessible by user

* chore: clean TODO

* fix: typo attachement -> attachment

* revert un-needed go.sum change

* refactor: move models logic to models

* fix TestCreateIssueAttachment which was wrongly successful

* fix unit tests with unittype added

* fix unit tests with changes

* use a valid uuid format for pgsql int. test

* test: add unit test TestLinkedRepository

* refactor: allow uploader to access unlinked attachement

* add missing blank line

* refactor: move to a separate function repo.GetAttachment

* typo

* test: remove err test return

* refactor: use repo perm for access checking generally + 404 for all reject
2020-01-05 01:20:08 +02:00

96 lines
1.6 KiB
YAML

-
id: 1
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
issue_id: 1
comment_id: 0
name: attach1
download_count: 0
created_unix: 946684800
-
id: 2
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a12
issue_id: 4
comment_id: 0
name: attach2
download_count: 1
created_unix: 946684800
-
id: 3
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a13
issue_id: 2
comment_id: 1
name: attach1
download_count: 0
created_unix: 946684800
-
id: 4
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a14
issue_id: 3
comment_id: 1
name: attach2
download_count: 1
created_unix: 946684800
-
id: 5
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a15
issue_id: 4
comment_id: 0
name: attach1
download_count: 0
created_unix: 946684800
-
id: 6
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a16
issue_id: 5
comment_id: 2
name: attach1
download_count: 0
created_unix: 946684800
-
id: 7
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a17
issue_id: 5
comment_id: 2
name: attach1
download_count: 0
created_unix: 946684800
-
id: 8
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a18
issue_id: 6
comment_id: 0
name: attach1
download_count: 0
created_unix: 946684800
-
id: 9
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a19
release_id: 1
name: attach1
download_count: 0
created_unix: 946684800
-
id: 10
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a20
uploader_id: 8
name: attach1
download_count: 0
created_unix: 946684800
-
id: 11
uuid: a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a21
release_id: 2
name: attach1
download_count: 0
created_unix: 946684800