Commit Graph

187 Commits (5ac5e46ee2954fdff7a32fa5df2923e99744efb7)

Author SHA1 Message Date
Max Shaposhnik cea3f482db
Factory support of devfile 2018-12-26 16:20:28 +02:00
Roman Iuvshyn b872b317cb
RELEASE: Set next development version (#12277) 2018-12-26 13:04:51 +02:00
Lukas Krejci 90903645ee Add an ability to get workspaces ids by status and threshold timestamp (#12177)
It includes:
- reworking Workspace Activity API to store timestamps of each status changes;
- add REST API endpoint to get workspaces ids by status and threshold timestamp;
2018-12-22 17:19:38 +02:00
Mykhailo Kuznietsov b7e1918e32
Upgrade dependencies (#11944) 2018-12-11 11:34:48 +02:00
Max Shaposhnik 3a14bacda1
Devfile local features implenentation with schema validation and automated model build. 2018-12-06 16:19:21 +02:00
Roman Iuvshyn 45490d2a3b
RELEASE: Set next development version (#12115) 2018-12-05 18:33:02 +02:00
Lukas Krejci 9109cf37c5 Workspace tracing (#11924)
* Adding support for @Traced annotation to enable whole method tracing
* Trace the creation and removal of workspace
* Trace the start of async start of the workspace
Note that this does not actually trace the async operations but merely
the "kick off" of those. For tracing the async operations, we need to
introduce support for propagating the span ids over the thread boundaries
using opentracing-concurrent.
* Enable tracing across the thread boundaries by augmenting the
WorkspaceSharedPool threadpool with tracing support.
Note that this does not add any new traces, merely enables the async
tracing.
* Add support for adding tags to @Traced methods.
The interceptor also reports the actual invoked class and method
(cleansed of Guice subclass name garbage)
* Trace the startup of pods during workspace startup.
* Trace stop of a workspace
* Introduce utility methods for tracing parts of methods.
* Trace provisioning of k8s objects (in both Kubernetes and Openshift
infrastructures).
* Create a common set of tags and enable strongly typed tags
* Apply the standard tags instead of hardcoded strings.
* Adding @Beta annotations for the tracing-related classes.
This needs to stabilize first.
* Replacing the "Traces" machinery with just annotated package private methods.
This way the code is easier to ready while we also keep all the flexibility
needed for the tag definitions.
* Rename CheTags to more descriptive TracingTags.
* Evaluate the tag values lazily.
This will reduce the load when tracing is switched off.
* Simplify the machine startup tracing logic and distinguish between
true error and mere cancellation due to prior errors.
* Trivial - applying formatting.
* Use getContext().getEnvironment().getMachines().size() to get the precise
number of machines that will be starting up.
* Trivial - change the name of the machine creation tag
* Use a formatted message instead of string concat.
* Update to the latest parent so that che-core-commons-tracing is correctly
incorporated into the full build.
* Fix tracing of the asynchronous stop of a workspace.
* Don't fall over when tracing is not available.
2018-11-22 21:51:12 +02:00
Oleksandr Garagatyi aaa8f424cd
Make a workspace run without any user env (#11890)
Allows running Che 7 workspace without any user environment but with Che 7 tooling set.
Workspace without environment has an empty list of environments and null value in `defaultEnv` field.
Field `activeEnv` is supposed to be `null` too.
What is changed:
- Migration of DB
- make defaultEnv nullable
- remove env_name from runtimes primary key
- make env_name in runtimes nullable
- Make code respect the fact that there are workspaces with no env
- settings API that returns the list of supported environment types returns no-environment type that - indicates that infrastructure support workspace with no environment at all.
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2018-11-21 16:39:54 +02:00
Roman Iuvshyn 99afaef87f
RELEASE: Set next development version (#11930) 2018-11-14 12:29:03 +02:00
Roman Iuvshyn 365d25f275
RELEASE: Set next development version (#11710) 2018-10-24 16:38:03 +03:00
Mykhailo Kuznietsov 56973d2169
Fix exception handling in permissions DAO (#11684) 2018-10-24 09:58:37 +03:00
Thomas Mäder 979b419dca Simplify jdtls pr (#10984)
* Restore jdt ui dependencies
* Undo spurious copyright changes

Signed-off-by: Thomas Mäder <tmader@redhat.com>
2018-10-17 15:05:02 +02:00
Anatoliy Bazko b5c20363c5 Fix after rebasing
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
2018-10-17 15:05:02 +02:00
Anatoliy Bazko 78b8898e37 Fix after che release
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
2018-10-17 15:05:02 +02:00
Anatoliy Bazko 97d1b951cb Set license header (#8268)
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
2018-10-17 15:05:02 +02:00
Sergii Leshchenko a4629c2e4d Move recovering of runtimes out of PostConstruct phase (PR #11592) 2018-10-13 17:33:26 +03:00
David Festal 534a961e84
Provide better compatibility with alternate OIDC providers (#11090)
Currently in Che there are still a number of requirements in upstream that are not required by the OIDC specification, so that Che still cannot be used with a number of OIDC compliant providers.
For example, in order to have Che working with the [`node-oidc-provider`](https://github.com/panva/node-oidc-provider), the following changes were necessary:

- Remove the requirement to have the email as a claim in the JWT access
token: this is not required the specification and is not supported by a
number of OIDC providers. Normally, the Id token contains such claims.

  So now if the email is not in the JWT token the first time the user connects to Che, ten the email is retrieved from the OIDC provider through its `user-profile` endpoint.

- Explicitely specify the the `openid email profile` scope when requesting the access token. Because OIDC providers, when answering to the `userInfo` endpoint, are expected to return claims that corresponds to the scopes of the access token. So if an access token has the `openid` scope only, the `userinfo` might return no claim at all (according to the specification).

  Until now it was working since keycloak allows adding claims to the returned tokens anyway.

- Allow supporting fixed redirect Uris: most OIDC providers support having a list of redirect URIs to come back to after the authorization step.  But these authorized Uris don't necessarily support wildcards or prefix. Che doesn't support this currently, and these changes introduce 2 fixed callback HTML pages that redirect to the Dashboard / IDE URL of the final page we want to come back to after authentication. This makes Che compatible with more OIDC providers

  We introduced a new boolean property to enable / disable fixed redirect URLs:
  `che.keycloak.use_fixed_redirect_urls` 
  whose default value is `false`

- The previous points required some light changes in the Keycloak Javascript adapter file, that we will submit as a PR to the Keycloak project. I, the meantime the `OIDCKeycloak.js` file is still used, but has been updated to be now based on the `keycloak.js` file of the last `4.5.0-final` Keycloak release. This will make this Keycloak PR easier to get accepted.

  Please keep in mind that this version upgrade only impacts the alternate OIDC provider case: when using a real Keycloak server, Che *always uses the `keycloak.js` file provided by the Keycloak server*. 


Signed-off-by: David Festal <dfestal@redhat.com>
2018-10-10 20:52:35 +02:00
Sergii Kabashniuk 65bd65e23b Upgrade to new dependency mockito-testng (#10647) 2018-10-10 13:58:33 +03:00
Max Shaposhnik aa8d0fa57d
Merge mysql sql schema into common bundle 2018-10-05 12:08:41 +03:00
Sergii Leshchenko a222971865 Replace MachineLogEvent with more abstract RuntimeLogEvent 2018-10-04 21:12:36 +03:00
Sergii Leshchenko 6abb78a189 Add RuntimeId to plugin broker events instead of workspace id field 2018-10-04 21:12:36 +03:00
Roman Iuvshyn 63b389c2fe
RELEASE: Set next development version (#11434)
* RELEASE: Set next development version
2018-10-04 18:25:39 +03:00
Max Shaposhnik 89041db8d1
Provide support for MySQL & add integration tests 2018-10-01 18:08:02 +03:00
Max Shaposhnik a0412fffdc
Make methods accessible with machine token configurable 2018-10-01 10:13:44 +03:00
Sergii Leshchenko d9c210bd2a Make BrokerEvent suitable to be used for STARTED status event 2018-09-27 17:49:35 +03:00
Max Shaposhnik f838ea5a60
Add extra workspace existence check before creating keypair 2018-09-19 16:59:22 +03:00
Max Shaposhnik 01d9fc73da
Limit scope of the machine token signed requests 2018-09-18 17:23:59 +03:00
Roman Iuvshyn ea410c3340
RELEASE: Set next development version (#11169) 2018-09-12 11:53:42 +03:00
Sergii Leshchenko 2a2b722cde
Add authorization checks for all factory service's methods (#11156)
Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>
2018-09-11 10:31:44 +03:00
Sergii Leshchenko 6a6c7f7e79
CHE-11080 Add authorization checks for BrokerService's JSON RPC methods (#11092) 2018-09-07 07:06:16 +03:00
Sergii Leshchenko e62dbb72cb CHE-10861 Add permissions check for organization related remote subscriptions 2018-09-04 11:07:00 +03:00
Sergii Leshchenko dfb5852da8 CHE-10861 Add permissions check for system related remote subscriptions 2018-09-04 11:07:00 +03:00
Sergii Leshchenko f8e0440e87 CHE-10861 Add permissions check for workspaces related remote subscriptions 2018-09-04 11:07:00 +03:00
Sergii Leshchenko 194e2c5eff CHE-10861 Add an ability to register permissions check for remote subscription 2018-09-04 11:07:00 +03:00
Sergii Leshchenko 6f125e8fc1 CHE-10861 Add permissions filter for installer json rpc methods 2018-09-04 11:07:00 +03:00
Sergii Leshchenko 6a55994f07 Fix scope of test dependencies
It allows to build a project without tests compiling
2018-09-04 11:07:00 +03:00
Oleksandr Garagatyi 27bed82d5c
CHE-10561: Rework WS.NEXT flow to latest concept of plugin broker (#10740)
* Move wsnext flow in Kubernetes infra implementation

Now we need to start a broker and pass meta.yaml files to it.
Starting a broker is infra-specific stuff, so it has to be done
on the infra implementation side because we don't have a part
in the infra SPI that would allow us to start a broker.
Passing Meta files using InternalEnvironment object is more
invasive than passing only attributes. So, this commit applies
less invasive scheme.

* CHE-10202,10561: Add fetching of Che editor, plugins meta from the registry

Add fetching of Che editor ID from workspace attributes.
Add fetching of Che plugins IDs from workspace attributes.
Use colon sign for separating editor/plugin ID and version
instead of the slash.
Remove old Workspace.Next model objects.

* CHE-10561: Share WS.NEXT between k8s and OS infras

Use WS.NEXT in both k8s and OS infrastructure implementations.

* CHE-10561: fix fetching meta.yaml files from che-plugin-registry

* CHE-10561: Fix sidecar model serialization

Fixes the fact that some fields in workspace sidecar tooling model
POJOs were incorrectly named or required custom serialization of
fields.

* CHE-10561: Add listening of che-plugin-broker

Add code that allows listening for events from Che plugin broker.
An event might contain workspace tooling config as a result if the broker
finished successfully or error otherwise.

* CHE-10561: Add PluginBrokerManager to control broker lifecycle

Adds PluginBrokerManager that configures/starts/waits Che plugin
broker.

Remove unused code.
Remove notion of Workspace next.

* Align plugin registry property between different components

* Fix extra  path in che plugin registry URL

Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2018-09-03 08:57:32 +03:00
Sergii Leshchenko f39f9b6280 CHE-10861 Add storing of Che Subject into http session in MachineLogin filters 2018-08-30 10:17:04 +03:00
Sergii Leshchenko 2c7bfd4ff9 Move exclude of OIDCKeycloak.js to mapping instead of Filter class 2018-08-30 10:16:43 +03:00
Max Shaposhnik 409c389eb4
Show meaningful message when we cannot authenticate user (due to absend email or other error) (#10889) 2018-08-24 08:39:35 +03:00
Roman Iuvshyn d99b2ed73d
RELEASE: Set next development version (#10867)
* RELEASE: Set next development version
2018-08-22 12:06:38 +03:00
Max Shaposhnik 47b8ed328b
Make machine token signing key per-workspace & renew them after each ws restart 2018-08-20 09:51:04 +03:00
Sergii Leshchenko de1459c52b Add attributes field to workspace config object 2018-08-10 14:06:41 +03:00
Anatoliy Bazko 4169b8d746
Fix build after applying new formatter (#10695)
Signed-off-by: Anatoliy Bazko <abazko@redhat.com>
2018-08-08 08:21:35 +00:00
Victor V. Rubezhny 57c43ac8cd Update fmt plugin to latest to enable skipping check #10554 (#10667)
The files are reformatted in order to suit the requirements of coveo maven fmt plug-in of v.2.5.1

Signed-off-by: Victor Rubezhny <vrubezhny@redhat.com>
2018-08-08 07:20:05 +00:00
Sergii Leshchenko 3ce288dd25 CHE-10536 Do not expose workspace runtime for user if he does not have `use` permission 2018-08-08 08:46:32 +03:00
Sergii Leshchenko 4be32e2e15 Remove outdated MachineService's methods from WorkspacePermissionsFilter 2018-08-08 08:46:32 +03:00
Sergii Leshchenko 5ca81b7592 Fix binding of UnavailableResourceInMultiUserFilter for ProfileService's methods
Previously, it banned only update profile attributes of the specified user
(PUT /profile/{USER_ID}/attributes) but methods related to current user
were still available (DELETE /profile/attributes and PUT
/profile/attributes)
2018-08-07 09:02:28 +03:00
Sergii Leshchenko a69162da89 CHE-10620 Add an ability to remove user when third-party user management service is configured 2018-08-07 09:02:28 +03:00
Roman Iuvshyn 60da580c92
RELEASE: Set next development version (#10603) 2018-08-02 12:38:48 +03:00