Commit Graph

173 Commits (fc2f76bc5c8a6146cdaca34eb2bb60ca8e30aaee)

Author SHA1 Message Date
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
Mykhailo Kuznietsov 07263f1e30
Fix license header text (#10629) 2018-08-02 11:18:04 +03:00
Mykhailo Kuznietsov 15d23edc91
Update license to EPL 2.0 (#10531) 2018-07-31 11:24:36 +03:00
Max Shaposhnik 1471003ae4
Add exclusions mechanism into jwtproxy config builder & exlude liveness probes from auth 2018-07-24 18:18:26 +03:00
Roman Iuvshyn 985d368f2d
RELEASE: Set next development version (#10345)
* RELEASE: Set next development version
2018-07-10 15:56:52 +03:00
Sergii Leshchenko fef7cc44e6
Fix scope of test dependencies (#10254) 2018-07-04 11:23:20 +03:00
Max Shaposhnik e7866c5b92
Make Authorization header value more uniform and use 'Bearer' prefix (#10197) 2018-06-27 09:52:44 +03:00
Roman Iuvshyn d7e1c73cf8
RELEASE: Set next development version (#10110) 2018-06-19 17:24:50 +03:00
Sergii Leshchenko e3fb7e3634 CHE-5918 Add an ability to interrupt Kubernetes/OpenShift runtime start
Signed-off-by: Sergii Leshchenko <sleshche@redhat.com>
2018-06-06 15:17:10 +03:00
i300543 34e6ab326f Improve wsmaster OpenIdConnect configurability, and helm deployment scripts (#9826)
* Improve wsmaster OpenIdConnect configurability, and helm deployment scripts
- Make username claim configurable  in cases
  Oidc provider does not support the default claim (default is "preferred_user")
- Introduce fallback for username (issuer+subject) if the username claim is not present
  in the token
- Extend helm scripts to take customOidcProvider and customOidcUsernameClaim
  parameters into account when deploying che master.
- Introduce cheDedicatedKeycloak global param, conditioning if dedicated che
  keycloak server should be deployed, and waited on by the master.
- default value for cheDedicatedKeycloak (if not defined) is true
  if the cheDedicatedKeycloak parameter is defined and is false,
  customOidcProvicer must be supplied, when using multiuser mode.

Signed-off-by: Sergey Kuperman <sergey.kuperman@sap.com>

* Code review fixes

Remove the extra if condition in configmap.yaml
Remove extra line in requirements.yaml
fix typo in deployment.yaml

* Add che.keycloak.username_claim property as NULL into multiuser.properties

* Simplify helm conditions, when deploying che master with or without keycloak

if multiuser = true, and .Values.customOidcProvider was supplied, assumption is that
we work with no keycloak (no waiting in deployment)

global.cheDedicatedKeycloak is still needed as separate variable for requirements.yaml to determine whether keycloak chart should be installed

so for keycloak deployment, no parameters need to be passed beside global.multiuser=true,
for custom OIDC :
.Values.customOidcProvider=http://url, and global.cheDedicatedKeycloak=false
both need to be set
2018-06-06 10:35:04 +03:00
Oleksandr Garagatyi f6b639d0f7 CHE-8265: Apply workspace next features in WorkspaceRuntimes
Signed-off-by: Oleksandr Garagatyi <ogaragat@redhat.com>
2018-06-04 17:17:44 +03:00
Roman Iuvshyn 7231585f4b
RELEASE: Set next development version (#9862) 2018-05-30 12:01:54 +03:00
David Festal e0890235fa
Allow creating OpenShift objects under the current user account on OCP (#9577)
* Support identity provider token retrieval in both JSON or URL formats.

That's required because some identity providers (such a `openshift-v3`)
correctly return the token information in JSON, as expected. So
switching to the url-based syntax should only used when the returned
json is invalid.

Signed-off-by: David Festal <dfestal@redhat.com>

* Introduce an `OpenShiftClientConfigFactory` to allow customizing the OpenShift config returned according to the current context (workspace ID, current user)

Signed-off-by: David Festal <dfestal@redhat.com>

* Openshift Infra + Multi-user => allow using OpenShift identity provider to connect to openshift with the OS oauth token of the current Che user.

This introduces a new property:

`che.infra.openshift.oauth_identity_provider`

Signed-off-by: David Festal <dfestal@redhat.com>

* Notify the user when a workspace cannot be started from the nav bar.

Signed-off-by: David Festal <dfestal@redhat.com>

* Add the ability to install the Openshift certificate into Keycloak

Signed-off-by: David Festal <dfestal@redhat.com>

* Add a yaml file to provide the openshift certificate as a secret,

in case it has to be installed into the dedicated Keycloak server.

Then the commands to install Che multiuser on Minishift with this
certificate are:

```
oc new-project che

oc process -f multi/openshift-certificate-secret.yaml -p
CERTIFICATE="$(minishift ssh docker exec origin /bin/cat
./openshift.local.config/master/ca.crt)" | oc apply -f -; \
oc new-app -f multi/postgres-template.yaml; \
oc new-app -f multi/keycloak-template.yaml -p ROUTING_SUFFIX=$(minishift
ip).nip.io; \
oc apply -f pvc/che-server-pvc.yaml; \
oc new-app -f che-server-template.yaml -p ROUTING_SUFFIX=$(minishift
ip).nip.io -p CHE_MULTIUSER=true -p
CHE_INFRA_OPENSHIFT_OAUTH__IDENTITY__PROVIDER=openshift-v3; \
oc set volume dc/che --add -m /data --name=che-data-volume
--claim-name=che-data-volume
```

Of course it's still needed to register the `openshift-v3` identity
provider in the Keycloak server, as well as, add the corresponding
`OAuthClient` object in Minihshift.

Signed-off-by: David Festal <dfestal@redhat.com>
2018-05-28 11:39:44 +02:00
Anton Korneta deae9c25d5 Add JGroups based status cache and lock service 2018-05-17 11:50:00 +03:00
Anton Korneta 0d510824c0 Add missed termination for DistributedRemoteSubscriptionStorage 2018-05-17 11:50:00 +03:00