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

Rebrand idm service #54

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 3 additions & 3 deletions services/idm/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# IDM

The IDM service provides a minimal LDAP Service, based on [Libregraph idm](https://github.com/libregraph/idm), for oCIS. It is started as part of the default configuration and serves as a central place for storing user and group information.
The IDM service provides a minimal LDAP Service, based on [Libregraph idm](https://github.com/libregraph/idm), for OpenCloud. It is started as part of the default configuration and serves as a central place for storing user and group information.

It is mainly targeted at small oCIS installations. For larger setups it is recommended to replace IDM with a “real” LDAP server or to switch to an external identity management solution.
It is mainly targeted at small OpenCloud installations. For larger setups it is recommended to replace IDM with a “real” LDAP server or to switch to an external identity management solution.

IDM listens on port 9235 by default. In the default configuration it only accepts TLS-protected connections (LDAPS). The BaseDN of the LDAP tree is `o=libregraph-idm`. IDM gives LDAP write permissions to a single user (DN: `uid=libregraph,ou=sysusers,o=libregraph-idm`). Any other authenticated user has read-only access. IDM stores its data in a boltdb file `idm/ocis.boltdb` inside the oCIS base data directory.
IDM listens on port 9235 by default. In the default configuration it only accepts TLS-protected connections (LDAPS). The BaseDN of the LDAP tree is `o=libregraph-idm`. IDM gives LDAP write permissions to a single user (DN: `uid=libregraph,ou=sysusers,o=libregraph-idm`). Any other authenticated user has read-only access. IDM stores its data in a boltdb file `idm/idm.boltdb` inside the OpenCloud base data directory.

Note: IDM is limited in its functionality. It only supports a subset of the LDAP operations (namely `BIND`, `SEARCH`, `ADD`, `MODIFY`, `DELETE`). Also, IDM currently does not do any schema verification (like. structural vs. auxiliary object classes, require and option attributes, syntax checks, …). Therefore it is not meant as a general purpose LDAP server.
2 changes: 1 addition & 1 deletion services/idm/ldif/base.ldif.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ givenName: Admin
sn: Admin
cn: admin
displayName: Admin
description: An admin for this oCIS instance.
description: An admin for this OpenCloud instance.
mail: [email protected]
ownCloudUUID: {{ .ID }}
oCExternalIdentity: $ {{ .Issuer }} $ {{ .ID }}
Expand Down
2 changes: 1 addition & 1 deletion services/idm/pkg/command/resetpw.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func resetPassword(_ context.Context, logger log.Logger, cfg *config.Config, use
Timeout: 1 * time.Millisecond,
}
if err := bdb.Configure(servercfg.Logger, servercfg.LDAPBaseDN, servercfg.BoltDBFile, &opts); err != nil {
fmt.Fprintf(os.Stderr, "Failed to open database: '%s'. Please stop any running ocis/idm instance, as this tool requires exclusive access to the database.\n", err)
fmt.Fprintf(os.Stderr, "Failed to open database: '%s'. Please stop any running OpenCloud idm instance, as this tool requires exclusive access to the database.\n", err)
return err
}
defer bdb.Close()
Expand Down
4 changes: 2 additions & 2 deletions services/idm/pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ func GetCommands(cfg *config.Config) cli.Commands {
}
}

// Execute is the entry point for the ocis-idm command.
// Execute is the entry point for the opencloud idm command.
func Execute(cfg *config.Config) error {
app := clihelper.DefaultApp(&cli.App{
Name: "idm",
Usage: "Embedded LDAP service for oCIS",
Usage: "Embedded LDAP service for OpenCloud",
Commands: GetCommands(cfg),
})

Expand Down
2 changes: 1 addition & 1 deletion services/idm/pkg/command/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ func bootstrap(logger log.Logger, cfg *config.Config, srvcfg server.Config) erro
if cfg.AdminUserID != "" {
serviceUsers = append(serviceUsers, svcUser{
Name: "admin",
Password: cfg.ServiceUserPasswords.OcisAdmin,
Password: cfg.ServiceUserPasswords.OCAdmin,
ID: cfg.AdminUserID,
Issuer: cfg.DemoUsersIssuerUrl,
})
Expand Down
8 changes: 4 additions & 4 deletions services/idm/pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ type Settings struct {
}

type ServiceUserPasswords struct {
OcisAdmin string `yaml:"admin_password" env:"IDM_ADMIN_PASSWORD" desc:"Password to set for the oCIS 'admin' user. Either cleartext or an argon2id hash." introductionVersion:"pre5.0"`
Idm string `yaml:"idm_password" env:"IDM_SVC_PASSWORD" desc:"Password to set for the 'idm' service user. Either cleartext or an argon2id hash." introductionVersion:"pre5.0"`
Reva string `yaml:"reva_password" env:"IDM_REVASVC_PASSWORD" desc:"Password to set for the 'reva' service user. Either cleartext or an argon2id hash." introductionVersion:"pre5.0"`
Idp string `yaml:"idp_password" env:"IDM_IDPSVC_PASSWORD" desc:"Password to set for the 'idp' service user. Either cleartext or an argon2id hash." introductionVersion:"pre5.0"`
OCAdmin string `yaml:"admin_password" env:"IDM_ADMIN_PASSWORD" desc:"Password to set for the OpenCloud 'admin' user. Either cleartext or an argon2id hash." introductionVersion:"pre5.0"`
Idm string `yaml:"idm_password" env:"IDM_SVC_PASSWORD" desc:"Password to set for the 'idm' service user. Either cleartext or an argon2id hash." introductionVersion:"pre5.0"`
Reva string `yaml:"reva_password" env:"IDM_REVASVC_PASSWORD" desc:"Password to set for the 'reva' service user. Either cleartext or an argon2id hash." introductionVersion:"pre5.0"`
Idp string `yaml:"idp_password" env:"IDM_IDPSVC_PASSWORD" desc:"Password to set for the 'idp' service user. Either cleartext or an argon2id hash." introductionVersion:"pre5.0"`
}
2 changes: 1 addition & 1 deletion services/idm/pkg/config/defaults/defaultconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func DefaultConfig() *config.Config {
LDAPSAddr: "127.0.0.1:9235",
Cert: path.Join(defaults.BaseDataPath(), "idm", "ldap.crt"),
Key: path.Join(defaults.BaseDataPath(), "idm", "ldap.key"),
DatabasePath: path.Join(defaults.BaseDataPath(), "idm", "ocis.boltdb"),
DatabasePath: path.Join(defaults.BaseDataPath(), "idm", "idm.boltdb"),
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion services/idm/pkg/config/parser/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func Validate(cfg *config.Config) error {
return shared.MissingServiceUserPassword(cfg.Service.Name, "IDM")
}

if cfg.AdminUserID != "" && cfg.ServiceUserPasswords.OcisAdmin == "" {
if cfg.AdminUserID != "" && cfg.ServiceUserPasswords.OCAdmin == "" {
return shared.MissingServiceUserPassword(cfg.Service.Name, "admin")
}

Expand Down
Loading