Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce ADR #1042

Merged
merged 7 commits into from
Feb 10, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions changelog/unreleased/introduce-adr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Introduce ADR

We will keep track of [Architectual Decision Records using Markdown](https://adr.github.io/madr/) in `/docs/adr`.

https://github.com/owncloud/ocis/pull/1042
43 changes: 43 additions & 0 deletions docs/adr/0001-introduce-accounts-service.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 1. Introduce an accounts service

* Status: superseded by [ADR-0003](0003-outsource-user-management.md) <!-- optional -->
* Deciders: @butonic, @felixboehm, @mbarz, @pmaier1 <!-- optional -->
butonic marked this conversation as resolved.
Show resolved Hide resolved
* Date: [2020-06-15](https://github.com/owncloud/ocis-accounts/pull/34/commits/2fd05e2b6fe2a47c687bd0c0bc5e1b5c48a585b2) <!-- optional -->

Technical Story: [persist accounts](https://github.com/owncloud/ocis-accounts/pull/34) <!-- optional -->

## Context and Problem Statement

To attach metadata like shares to users ownCloud relies on persistent, non-reassignable, unique identifiers for users (and files). Email und username can change when a user changes his name. But even the OIDC sub+iss combination may change when the IdP changes. While there is [an account porting protocol](https://openid.net/specs/openid-connect-account-porting-1_0.html) that describes how a relying party such as ownCloud should should behave, it still requires the RP to maintain its own user identifiers.
butonic marked this conversation as resolved.
Show resolved Hide resolved

## Decision Drivers <!-- optional -->

* OCIS should be a single binary that can run out of the box without external dependencies like an LDAP server.
* Time: we want to build a release candidate asap.
* Firewalls need access to guests, typically via LDAP.
* Not all external LDAPs are writebale for us to provision Guest accounts.
butonic marked this conversation as resolved.
Show resolved Hide resolved
* We see multiple LDAP servers in deployments. Being able to handle them is important and should be coveredy by using OIDC + being able to query multiple LDAP servers.
butonic marked this conversation as resolved.
Show resolved Hide resolved

## Considered Options

* Accounts service wraps LDAP
* GLauth wraps accounts service
butonic marked this conversation as resolved.
Show resolved Hide resolved

## Decision Outcome

Chosen option: "GLauth wraps accounts service", because we need write access to provision guest accounts and [GLauth](https://github.com/glauth/glauth) currently has no write support.
butonic marked this conversation as resolved.
Show resolved Hide resolved

### Positive Consequences <!-- optional -->

* We can build a self contained user management in the accounts service and can adjust it to our requirements.
* We do not rely on an LDAP server which would only be possible by implementing write support in the LDAP libraries used by GLauth which (hard to estimate effort, when will that be merged upstream).
butonic marked this conversation as resolved.
Show resolved Hide resolved

### Negative Consequences <!-- optional -->

* We need to spend time on implementing user management

## Pros and Cons of the Options <!-- optional -->

### Accounts service wraps LDAP

* Bad, because not all external LDAPs are writebale for us to provision Guest accounts.
butonic marked this conversation as resolved.
Show resolved Hide resolved
29 changes: 29 additions & 0 deletions docs/adr/0002-persist-accounts-using-cs3-storage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 2. Persist accounts in a CS3 storage

* Status: accepted <!-- optional -->
* Deciders: @butonic, @felixboehm <!-- optional -->
* Date: 2020-08-21 <!-- optional -->

Technical Story: [File system based indexing](https://github.com/owncloud/ocis-accounts/pull/92) <!-- optional -->

## Context and Problem Statement

To set up HA or a geo replicated setup we need to persist accounts in a distributed way. Furthermore, the bleve index makes the accounts service stateful, which we wand to avoid for a scale out deployment.
butonic marked this conversation as resolved.
Show resolved Hide resolved
refs marked this conversation as resolved.
Show resolved Hide resolved

butonic marked this conversation as resolved.
Show resolved Hide resolved
## Considered Options

* Look into distributed bleve
* Persist users in a CS3 storage

## Decision Outcome

Chosen option: "Persist users in a CS3 storage", because we have one service less running and can rely on the filesystem for geo replication and HA.
butonic marked this conversation as resolved.
Show resolved Hide resolved

### Positive Consequences <!-- optional -->

* We can store accounts on the storage using the CS3 API, pushing geo-distribution to the storage layer.
* Backups of users and storage can be implemented without inconsistencies between using snapshots.

### Negative Consequences <!-- optional -->

* We need to spend time on implementing a reverse index based on files, and symlinks.
91 changes: 91 additions & 0 deletions docs/adr/0003-outsource-user-management.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# 3. Outsource Usermanagement
butonic marked this conversation as resolved.
Show resolved Hide resolved
refs marked this conversation as resolved.
Show resolved Hide resolved

* Status: accepted <!-- optional -->
* Deciders: @butonic, @mbarz, @kfreitag, @hd, @pmaier1 <!-- optional -->
butonic marked this conversation as resolved.
Show resolved Hide resolved
* Date: 2020-12-09 <!-- optional -->

Technical Story: [Skip account-service by talking to CS3 user-api](https://github.com/owncloud/ocis/pull/1020) <!-- optional -->

## Context and Problem Statement

To attach metadata like shares to users ownCloud relies on persistent, non-reassignable, unique identifiers for users (and files). Email und username can change when a user changes his name. But even the OIDC sub+iss combination may change when the IdP changes. While there is [an account porting protocol](https://openid.net/specs/openid-connect-account-porting-1_0.html) that describes how a relying party such as ownCloud should should behave, it still requires the RP to maintain its own user identifiers.
butonic marked this conversation as resolved.
Show resolved Hide resolved

## Decision Drivers <!-- optional -->

* OCIS should be a single binary that can run out of the box without external dependencies like an LDAP server.
* Time: we want to build a release candiddate asap.
butonic marked this conversation as resolved.
Show resolved Hide resolved

## Considered Options

* Accounts service wraps LDAP
* GLauth wraps accounts service
butonic marked this conversation as resolved.
Show resolved Hide resolved

## Decision Outcome

Chosen option: "Move accounts functionality to GLauth and name it accounts", by moving the existing accounts service file based persistence to glauth and use it as a drop in replacement for an LDAP server. The reverse index and web ui existing in the accounts service will move as well in order to make glauth a standalone, small scale user management with write capabilities.
butonic marked this conversation as resolved.
Show resolved Hide resolved

### Product summary
- GLauth is a drop in user management for small scale deployments.
butonic marked this conversation as resolved.
Show resolved Hide resolved
- OCIS admins can either use the web ui to manage users in glauth or use existing tools in their IDM.
butonic marked this conversation as resolved.
Show resolved Hide resolved
- We hide the complexity by embedding OpenID Provider, an LDAP server and a user management web ui.
butonic marked this conversation as resolved.
Show resolved Hide resolved

### Resulting deployment options
- Single binary: admin can manage users, groups and roles using the built in web ui (glauth)
butonic marked this conversation as resolved.
Show resolved Hide resolved
- External LDAP: OCIS admin needs do use existing tool to manage users
butonic marked this conversation as resolved.
Show resolved Hide resolved
- Separate OCIS and LDAP admin: OCIS admin relies on the LDAP admin to manage users

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about the two LDAP servers scenario, where we use the customers LDAP for internal users and another one (GLAuth?) for guest accounts? Might even make sense to have the web ui for disabling guest users...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GLauth already has a primary and fallback backend. The chain can easily be extended to multiple backends. login and single user properties can even be made in parallel. The only challenge is merging results when searching recipients in multiple ldap servers, but since 1000 results are not helpful for users we can limit the page size to 10 per ldap. Furthermore, multiple ldap servers indicate larger deployments where user lookup via ldap is restricted to exact matches, eg. the full email. In these cases merging becomes trivial again.

We may want to cache these queries anyway in order not flood ldap servers with lookup requests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided to make multiple LDAP servers possible through an additional service which works as a connector to multiple LDAP servers and exposes their user information via the GraphAPI

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would summarize the two comments to "GLAuth abstracts multiple LDAP servers that might exist into one that looks like one to the consumer. A GraphAPI will be provided to interact with GLAuth to manage guest users (for that, at least one of the LDAPs must be read/write)".

Thoughts:

  • The GLAuth must somehow expose if it allows write ops to create or edit (Guest-) Users or not.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reworked the list

### Resulting technical implications
- add graphapi to glauth so the ocis web ui can use it to manage users
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the web ui should move to GLAuth? Embedding it in oC Web could be done by wrapping it into an oC Web extension (need to check if that's possible. I don't want an iframe solution).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may not be able to theme the glauth web ui as we like it. Also the tight integration we have in the current implementation is awesome / slick. We need to embed glauth anyway. The first step would be to treat the current accounts service as the drop in ldap server with a web ui to manage users. It would mean merging ocis-accounts and ocis-glauth.
The next step would be to add the graph api to glauth. then we can build a web ui that uses glauth to manage accounts.

This accounts-management service would be a web ui to manage accounts via the graph api. It could be part of glauth or we use an embedded, tightly integrated version for ocis-web that follows our theme.

The final step would be a graphapi implementation that is backed by a real ldap server. I'd put that into glauth because it already has several backends. Having a graphapi <-> ldap proxy would fit GLauth I think.

But in order to have a truly embeddable web ui I think glauth shoul start with the graph api. It can then have a web ui or projects that want to embed it can build the ui in the way they want. The kopano guys @fbartels @longsleep might want to use react to embed it into konnectd.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added as a bullet point, because I agree: keep the ui in GLAuth

- make graphapi service to directly talk to an LDAP server so our web ui can use it
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get this one 😅 we don't want to bypass LDAP admins. Thought that the web ui for user management is only supposed to be used in case we have GLAuth as LDAP replacement.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Basic idea is the following: We don't need write access via the LDAP protocol when a IDM would have a second interaction point via the GraphAPI.

We can imagine quite a lot of scenarios, where e.g. the provisoining of guest users in the IDM would happen via a public http api endpoint.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah but we learned that for small scale deployments some admins actually prefer a simple ui ... 🤷
If the web ui is self contained, having it in glauth should be fine. I don't want to build the next keycloak ...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that even the super-duper LDAP is covered by a thin layer of GLAuth?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would a customer give us write access via GraphAPI when they don't want to give us write access via LDAP? 🤔 I thought about the web ui as an option to provide easy to use read/write access for the GLAuth tiny setup use case. As in the 5 people company that doesn't have an actual LDAP, the family who want to handle their photos and the like. Why would we want to build an accounts web ui for Siemens? They have their own tools for user management.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GLAuth cannot write to an ldap server, it can only write to other backends.

Reworded the list

- keep the accounts service but embed glauth
- add graph api to the accounts service?
butonic marked this conversation as resolved.
Show resolved Hide resolved

### Positive Consequences <!-- optional -->

* The accounts service (which is our drop in LDAP solution) can be disabled.
* No sync

### Negative Consequences <!-- optional -->

* If users want to store users in their IDM and at the same time guests in a seperate user management we need to implement ldap backends that support more than one LDAP server.

## Pros and Cons of the Options <!-- optional -->

### GLauth wraps accounts service
butonic marked this conversation as resolved.
Show resolved Hide resolved

Currently, the accounts service is the source of truth and we use it to implement user management. <!-- optional -->

* Good, because it solves the problem of storing and looking up an owncloud uuid for a user (and group)
* Good, because we can manage users out of the box
* Good, because we can persist accounts in a CS3 storage provider
* Bad, because it maintains a separate user repository: it needs to either learn or sync users.
* … <!-- numbers of pros and cons can vary -->
butonic marked this conversation as resolved.
Show resolved Hide resolved

### Move accounts functionality to GLauth and name it accounts

We should use an existing ldap server and make GLauth a drop in replacement for it. <!-- optional -->

* Good, because we can use an existing user repository (an LDAP server), no need to sync or learn users.
* Good, because admins can rely on existing user managemen tools.
butonic marked this conversation as resolved.
Show resolved Hide resolved
* Good, because we would have a clear seperation of concerns:
butonic marked this conversation as resolved.
Show resolved Hide resolved
- users reside in whatever repository, typically an LDAP server
- could be an existing LDAP server or AD
- could be our embeddable drop in glauth server
- we use a service to wrap the LDAP server with other APIs:
- graph API - ODATA based restful api,
- [SCIM](http://www.simplecloud.info/) - designed to manage user identities, supported by some IDPs,
- the current accounts API (which is a protobuf spec following the graph api)
- our account management ui can use the graph api service which can have different backends
- an existing ldap server
- our drop in glauth server (which might serve the graph api itself)
- the cs3 api + a future guest provisioning api + a future cs3 user provisioning api
- all ocis services can use the service registry to look up the accounts service that provides an internal api
- could be the CS3 user provider (and API)
- could be the internal protobuf accounts API
- introduce a new guest provisioning api to CS3 which properly captures our requirement to have them in the user repository
- guests need to be made available to the firewall
- storages like eos that integrate with the os for acl based file permissions need a numeric user and group id
* Good, because we can use the CS3 user proviter with the existing ldap / rest driver.
butonic marked this conversation as resolved.
Show resolved Hide resolved
* Bad, because OCIS admins may not have the rights to manage role assignments. (But this is handled at a different department.)
* Bad, because OCIS admins may not have the rights to disable users if an external LDAP is used instead of the drop in GLauth.
* … <!-- numbers of pros and cons can vary -->
butonic marked this conversation as resolved.
Show resolved Hide resolved