948 Commits
Author SHA1 Message Date
Douwe MaanandYorick Peterse 1d94757c1a Merge branch 'container-registry-token-ttl' into 'master'
Add Application Setting to configure Container Registry token expire delay (default 5min)

This adds an option to configure Container Registry token expire delay. The default is set to 5mins (something that is also used by Docker Hub).

What is left:
* [x] Write test to check the expire_delay

Fixes: https://gitlab.com/gitlab-org/gitlab-ce/issues/17890

@stanhu I think that this should land in patch release of 8.8.

See merge request !4364
2016-06-02 13:39:56 +02:00
Douwe MaanandYorick Peterse ce8773fec6 Merge branch 'zj-gitignore-dropdown' 2016-05-25 13:04:26 +02:00
Grzegorz Bizon da8b72d453 Extend runner options that are configurable via API 2016-05-19 22:01:53 +02:00
Rémy Coutable da8ac1635f Merge branch 'issue_17302' into 'master'
Fix api leaking notes when user is not authorized to read noteable

fixes #17302

See merge request !4102
2016-05-18 04:31:12 +00:00
Felipe Artur 5bf49bb63d Move note helper method to notes entity file 2016-05-17 21:41:53 -05:00
Felipe Artur c9be74e247 Fix single note api request 2016-05-16 16:43:19 -03:00
Douwe Maan 59e62fc486 Merge branch 'docker-registry' into 'master'
Added authentication service for docker registry

This adds a simple authentication service for docker which uses current user credentials to authenticate pulls and pushes.

I have only one concern. Since the `.docker/config` is unencrypted, thus the password for user stored there is unencrypted, maybe we should from the start implement function to generate/provide a separate password just for the purposes of accessing docker registry?

What do you think @jacobvosmaer @sytses @marin?

cc @marin 

See merge request !3787
2016-05-16 17:20:31 +00:00
Douwe Maan 7848d54f5b Clean up LegacyDiffNote somewhat 2016-05-13 17:31:58 -05:00
Douwe Maan 99d3e21f19 Extract LegacyDiffNote out of Note 2016-05-13 17:31:43 -05:00
Kamil Trzcinski 0958f331d1 Merge remote-tracking branch 'origin/master' into docker-registry
# Conflicts:
#	config/initializers/1_settings.rb
2016-05-13 17:14:46 -05:00
Gabriel Mazetto f5a0ac0fc1 Codestyle: make sure we have space around operators 2016-05-13 04:46:56 -03:00
Ahmad Sherif 0c22698bd4 Add API endpoints for un/subscribing from/to a label
Closes #15638
2016-05-12 22:48:09 +02:00
Robert Speicher 24f353edc4 Merge branch '17249-starred' into 'master'
Restrict starred projects to viewable ones

`User#starred_projects` doesn't perform any visibility checks. This has
a couple of problems:

1. It assumes a user can always view all of their starred projects in
   perpetuity (project not changed to private, access revoked, etc.).
2. It assumes that we'll only ever allow a user to star a project they
   can view. This is currently the case, but bugs happen.

Add `User#viewable_starred_projects` to filter the starred projects by
those the user either has explicit access to, or are public or
internal. Then use that in all places where we list the user's starred
projects.

Closes #17249.

See merge request !4108
2016-05-11 12:49:29 +00:00
Felipe Artur 93ca5c9964 Fix notes API calls symbol convertions 2016-05-10 16:06:02 -03:00
Sean McGivern 97424ea544 Restrict starred projects to viewable ones
`User#starred_projects` doesn't perform any visibility checks. This has
a couple of problems:

1. It assumes a user can always view all of their starred projects in
   perpetuity (project not changed to private, access revoked, etc.).
2. It assumes that we'll only ever allow a user to star a project they
   can view. This is currently the case, but bugs happen.

Add `User#viewable_starred_projects` to filter the starred projects by
those the user either has explicit access to, or are public or
internal. Then use that in all places where we list the user's starred
projects.
2016-05-10 18:13:52 +01:00
Rémy Coutable 5589dcf8db Fix a few places where autoloading would fail
- Fix naming of API::CommitStatuses
- Ensure we use require_dependency instead of require
- Ensure the namespace is right in lib/api/api.rb, otherwise, we
  might require Grape::API::Helpers which defines the `#params` method.
  This is to avoid requiring a file multiple times and getting an "Already
  initialized constant" error.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-05-10 11:51:19 +02:00
Felipe Artur e56e3cdc62 Fix api leaking notes when user is not authorized to read noteable 2016-05-09 19:35:37 -03:00
Kamil Trzcinski 1dea54c220 Remove unused parts 2016-05-09 20:35:01 +03:00
Kamil Trzcinski 0094d8f196 Rename images to container_registry 2016-05-09 20:29:57 +03:00
Kamil Trzcinski 51a8811e26 Revert "Eager load lib/api"
This reverts commit 0a280158ef.
2016-05-09 20:26:14 +03:00
Kamil Trzcinski 71da2e0b56 Merge remote-tracking branch 'origin/master' into docker-registry 2016-05-09 20:21:02 +03:00
Rémy Coutable f5240f9703 Expose MergeRequest#user_notes_count in the API and use the method in issues list
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-05-09 16:08:07 +02:00
cnam-depandRémy Coutable 5364400741 API: Expose Issue#user_notes_count 2016-05-09 16:07:35 +02:00
Douwe Maan 6a8359f3d3 Merge branch 'pacoguzman/gitlab-ce-15001-since-and-until-operators-api-commits'
# Conflicts:
#	Gemfile.lock
2016-05-04 17:27:47 +02:00
Robert Speicher c9bc3d20ef Merge remote-tracking branch 'dev/master' into 'master' 2016-05-02 19:58:54 -04:00
Timothy AndrewandKamil Trzcinski 0a280158ef Eager load lib/api
- So that the server doesn't have to be restarted for every change in dev.
2016-04-29 16:50:07 +02:00
Kamil Trzcinski 5fc310b440 Missing parameters of docker payload 2016-04-29 16:45:00 +02:00
Kamil Trzcinski 8aac802eaf Audience 2016-04-29 16:45:00 +02:00
Kamil Trzcinski 72611f9cfa Auth token 2016-04-29 16:45:00 +02:00
Kamil Trzcinski 0ca8db25f0 Try to fix auth service 2016-04-29 16:45:00 +02:00
Kamil Trzcinski 03b3fe13f6 Make images_enabled configurable 2016-04-29 16:45:00 +02:00
Kamil Trzcinski f41a3e24d2 Added authentication service for docker registry 2016-04-29 16:45:00 +02:00
Paco Guzman c4b9bd0413 API support for the 'since' and 'until' operators on commit requests
- Parameter validation as ISO8601 format
2016-04-29 09:26:52 +02:00
Stan Hu e99cf05875 Use ActionDispatch Remote IP for Akismet checking
Previously all remote IPs appeared at 127.0.0.1, which made Akismet
not very useful. Using the ActionDispatch Remote IP (http://api.rubyonrails.org/classes/ActionDispatch/RemoteIp.html)
should provide more reliable results.

Closes #16629
2016-04-27 22:12:55 -07:00
Robert Speicher 29a23a4478 Merge branch '15579-filter-milestone-confidential-issues-api' into 'master'
Prevent information disclosure via milestone API

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/15579

See merge request !1961
2016-04-26 00:37:01 +00:00
Stan Hu d5267dfd0d Prevent private snippets in public/internal projects from being leaked via API
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/15580
2016-04-25 12:02:06 -07:00
Stan HuandRémy Coutable 03ae2cdbff Filter confidential issues from milestones API if user does not have access
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/15579
2016-04-25 12:20:29 +02:00
Stan Hu 9413dd80f5 Prevent users from deleting Webhooks via API they do not own
Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/15576
2016-04-24 23:53:59 -07:00
Kamil Trzciński d240666800 Merge branch 'ci-commit-as-pipeline' into 'master'
Ci::Commit becomes a Pipeline object

1. Ci::Commit receives context: ref, :tag.
1. One Ci::Commit describes a one Pipeline
1. Pipeline is created from `.gitlab-ci.yml`
1. Pipeline is a ordered group of builds
1. We test MR against Pipeline
1. Pipelines have a separate view (https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3703)
1. Pipeline can be triggered from UI (https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3703)
1. Later we change `Trigger -> TriggerRequest -> Build` to `Trigger -> Pipeline` (future)
1. We add a Pipeline Hook that will be triggered on Pipeline status change  (future)
1. We extend notifications to use `Pipeline Hook` to send summary on pipeline changes (future)

After merging that I'll prepare a separate MR that will unify naming, database columns, table names:
```
Ci::Commit -> Pipeline
Ci::Build -> Build
CommitStatus -> Job
GenericCommitStatus -> ExternalJob

ci_commits -> pipelines
ci_builds -> jobs
```

This MR implements first 5 points.

This is made to solve this issue https://gitlab.com/gitlab-org/gitlab-ce/issues/14149.

See merge request !3653
2016-04-21 08:10:37 +00:00
Yorick Peterse a257d117a0 Fix setting of "action" for Grape transactions
Merely setting the "action" tag will only result in the transaction
itself containing a value for this tag. To ensure other metrics also
contain this tag we must set the action using Transaction#action=
instead.
2016-04-20 22:42:52 +02:00
Robert Speicher 3d4875f86a Merge branch 'license-templates-and-api-12804' into 'master'
License templates when creating/editing a LICENSE file

Closes #12804

See merge request !3660
2016-04-20 01:38:49 +00:00
Kamil Trzcinski 27e0c7723c Merge remote-tracking branch 'origin/master' into ci-commit-as-pipeline
# Conflicts:
#	db/schema.rb
2016-04-19 14:00:14 -04:00
Rémy Coutable bfa16dbcfb Merge branch 'api-fix-annotated-tags' into 'master'
API: Present an array of Gitlab::Git::Tag instead of array of rugged tags

The annotated message was always `null` because the wrong array was presented. 

The entity requires an array of `Gitlab::Git::Tags` instead an array of raw rugged tags was presented. Since a rugged tag does not respond to `message` to get the annotated message, this was always `null`. 

See merge request !3764
2016-04-19 12:31:31 +00:00
Rémy Coutable 50bee8e919 Rename License entity to RepoLicense to avoid conflict with EE
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-19 11:08:48 +02:00
Yorick Peterse b9698d2b45 Add "action" tag to /internal/allowed API
This allows us to re-use any other analytics that rely on the "action"
tag having a value set.
2016-04-18 17:44:24 +02:00
Felipe Artur 2366768d3b Add changelog entry 2016-04-18 11:12:28 -03:00
Felipe Artur 820c08cefd Fix documentation and improve permissions code 2016-04-18 11:12:28 -03:00
Felipe Artur ce96d482d9 Insert users check into api 2016-04-18 11:12:27 -03:00
Rémy Coutable 2f18c77e1b Update to licensee 8.0.0 and fix API specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-18 14:47:50 +02:00
Rémy Coutable 0aaaae9d05 Fix features specs (hopefully)
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-18 14:47:50 +02:00