Commit Graph

49 Commits

Author SHA1 Message Date
Filip Valder
3cb41aa5dc Changes in MBS restful API:
- Refactor MBS API code
- Unify module-/component_build API philosophy/design/approach
- Naming fixes
- _utc_datetime_to_iso moved from ModuleBuildAPI and is now a module-level function.
- Existing v1 API remains unchanged. ComponentBuildAPI now supports individual component build listing + verbose mode.
- documented in README
- various component_build API tests added
2017-09-11 14:48:22 +02:00
Filip Valder
7ef2975984 PEP8 fixes 2017-07-17 18:29:10 +02:00
Yashvardhan Nanavati
d79a9584c7 Find module build using attributes of a component build in koji 2017-07-07 14:37:43 -04:00
mprahl
3e819abcb6 Include the query arguments in the pagination metadata 2017-07-06 09:09:17 -04:00
Jakub Kadlčík
a86084746d Rename ALLOW_CUSTOM_URLS to ALLOW_CUSTOM_SCMURLS 2017-05-02 11:29:47 +02:00
Jakub Kadlčík
6dde52f377 Add config option for allowing custom scmurls 2017-04-19 15:25:22 +02:00
Jakub Kadlčík
b0ae5f98ef Have default NSV for modules submitted by yaml file 2017-04-18 08:23:38 +02:00
Jan Kaluža
9c60457dda Merge #461 NO_AUTH bugfix and improvement 2017-04-07 06:01:42 +00:00
Jan Kaluza
acf0e7097c Use FAS groups to manage MBS admins 2017-04-04 16:39:10 +02:00
Jakub Kadlčík
dcba6c8995 Support NO_AUTH changing owner in patch method 2017-03-30 12:21:01 +02:00
Jakub Kadlčík
0753c6be2d Move validate_optional_params to BaseHandler 2017-03-30 11:21:39 +02:00
Jakub Kadlčík
05bdece65a Don't allow NO_AUTH to be anything 2017-03-30 11:21:39 +02:00
Jakub Kadlčík
10d3c98381 Construct optional_params in base class 2017-03-30 11:01:13 +02:00
Jakub Kadlčík
ec0ed91d45 Allow to submit owner when NO_AUTH 2017-03-30 11:01:13 +02:00
Jakub Kadlčík
48808547f7 Refactor post methods to separate handlers 2017-03-30 11:01:13 +02:00
Jan Kaluza
c5f9d713cc Introduce 'admins' config option and allow users defined there to cancel any module build. 2017-03-29 12:58:44 +02:00
Ralph Bean
a8314cba09 Merge #425 Use the 403 Forbidden result in case the user is unauthorized 2017-03-14 13:11:10 +00:00
Ralph Bean
20671748ca Coerce submitted branch name from unicode to bytes.
I hit this in prod on the latest 1.3.4 release.
2017-03-13 14:48:51 -04:00
Patrick Uiterwijk
a4763ee316 Use the 403 Forbidden result in case the user is unauthorized
The difference between 401 Unauthorized and 403 Forbidden is that 403 Forbidden is "permanent":
it indicates that the user was authenticated correctly, but was not allowed to access this endpoint.
In contrast, 401 Unauthorized means that the request as posted was not allowed, but if the user
were to try again with (new) authorization tokens, it might actually succeed.

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
2017-03-13 07:34:36 +00:00
Jan Kaluza
4b3e295e48 Expect 'branch' while handling submission of module and use it to set the stream of module. Also verify that the commit hash belongs to that branch. 2017-03-07 11:25:06 +01:00
Filip Valder
6b343896dd s/rida/mbs/ 2017-02-28 17:59:02 +01:00
Filip Valder
13b7bcd03e Support for state tracing of modules and components
- DB migration scripts.
- Models: ComponentBuildTrace, ModuleBuildTrace.
- ModuleBuild.state_trace method for querying for a particular module's
state history.
- SQLAlchemy before commit session event handler for recording
module/component state changes.
- REST API verbose mode for getting state trace of a particular module.
- Tests use make_session, so that event handlers are in effect.
- Short info in README about verbose mode.
- Tests verifying whether state trace information about a module appears
in verbose mode.
- Other minor fixes (RidaBase -> MBSBase, PEP8...)
2017-02-28 16:15:43 +01:00
Jakub Kadlčík
9429114836 Get empty string if Content-Type is not in headers 2017-02-27 16:20:01 +01:00
Jakub Kadlčík
34ea4a8efe Move validate_optional_params function to utils.py 2017-02-26 22:23:50 +01:00
Jakub Kadlčík
7799515994 Use function for validating optional params to reduce code duplicity 2017-02-23 20:51:31 +01:00
Jakub Kadlčík
62e26ba652 Use better way of checking for forbidden columns 2017-02-23 20:51:31 +01:00
Jakub Kadlčík
5a65f50b52 Use built-in to_dict() function 2017-02-23 20:51:31 +01:00
Jakub Kadlčík
92dce63091 Allow submitting optional parameters such as copr_owner and copr_project 2017-02-23 20:51:31 +01:00
Matt Prahl
a5cc4eb280 Add a module's commit hash, scmurl, and the buildrequires' commit hashes, stream, and version in the modulemd 2017-02-21 09:53:05 -05:00
Jakub Kadlčík
1630c5f14f Raise user friendly exception when yaml submission is not allowed 2017-02-19 22:38:43 +01:00
Jakub Kadlčík
3e2ee93dd8 Rename conf option to YAML_SUBMIT_ALLOWED 2017-02-19 22:35:55 +01:00
Jakub Kadlčík
43b653097a Add config option for allowing of direct submitting yaml files to mbs 2017-02-19 22:35:55 +01:00
Jakub Kadlčík
43acbdbdba Implement possibility to submit yaml files (See #310) 2017-02-19 22:35:55 +01:00
Ralph Bean
88aca055ce Replace query to FAS with OIDC groups scope check.
This removes our query to FAS and fixes #304.

It is more flexible too, where we can now configure production to only
allow in members of the `modularity-wg` group, and then later open it up
to all packagers after F26 is out (as was agreed with FESCo).

In the process of working on this, I discovered that #305 is not
necessary.  We don't need our own scope; we can just use the `groups`
scope as done here.
2017-02-10 15:50:41 -05:00
Ralph Bean
d13c7991ed Cleanup in preparation for package review.
I'm taking on #235.  This is all stuff that came up while doing a
cursory package review myself.

- The source files all state that they are MIT, but the specfile and
  repo claimed to be GPL.  I switched everything to MIT (even though I
  favor GPL.. the source was MIT first before it was incorrectly
  labelled GPL).
- There are various bugs and lint issues in the specfile fixed here.
- Notably, the systemd service file is missing from the 1.0.0 tarball on
  PyPI, so I'll need to do a new release after this.
2016-12-12 15:09:58 -05:00
Filip Valder
7fcfe05f85 Fix issue #251:
- support for mupltiple SCM URLs (logic was broken when there were more
than one SCM URL in SCMURLS conf. var)

- unsplit-brain handling of SCM URLs between frontend and backend
2016-12-12 13:05:27 +01:00
Jan Kaluza
8cb4e0de5d Use OIDC to auth the users, replace submit-build.sh by submit-build.py which does hackish way of OIDC just to test things. 2016-12-02 14:52:04 +01:00
Matt Prahl
91af4a1840 Change cancel build API to be a PATCH instead 2016-11-30 15:00:32 -05:00
Jan Kaluža
bb5dd5f75c Merge #227 Fix #105 - Add new cancel API call which can be used to cancel the module build. 2016-11-30 15:56:34 +00:00
Jan Kaluza
1e4e1be91e Fix #105 - Add new cancel API call which can be used to cancel the module build. 2016-11-30 12:20:50 +01:00
Jan Kaluza
f7350a395f Allow file:// URLs when building modules locally 2016-11-30 10:33:20 +01:00
Filip Valder
f8496379eb cosmetic changes 2016-11-21 22:54:18 +01:00
Jan Kaluza
7b9e4f7234 Initial version of mock backend 2016-11-10 09:57:00 +01:00
Filip Valder
e4d69962fa fix: incorporate @ralph 's recommendation: flask.url_for 2016-11-07 20:14:29 +01:00
Filip Valder
dd4790f514 fix: issue #159 return state_url in JSON after module build submission 2016-11-07 13:13:01 +01:00
Ralph Bean
bb317a9323 Fix typo bug in our existence check.
This gave a traceback every time before.  We need a trailing comma there
in order to make that an `iterable`, otherwise our `in` check doesn't
make any sense.
2016-10-27 15:59:41 -04:00
Ralph Bean
1ce135412f Allow optional authz, to make dev much simpler. 2016-10-26 15:44:21 -04:00
Courtney Pacheco
dbe26fcfb5 Adding code to handle componentless builds 2016-10-25 03:29:58 -04:00
Matt Prahl
b4082dc551 Rename module from rida to module_build_service
Rename routes from /rida/1/module-builds/ to /module-build-service/1/module-builds/
2016-10-24 10:30:23 -04:00