Authorisation - badoo/codeisok GitHub Wiki

Codeisok authorisation is based on AUTH_METHOD_* setting set in .config/gitphp.conf.php file. There are 5 types of authorisation:

uyga@greybox ~/dev/codeisok (master) $ grep 'const AUTH_METHOD_' .include/Config.class.php
    const AUTH_METHOD_NONE    = 'none';
    const AUTH_METHOD_CROWD   = 'crowd';
    const AUTH_METHOD_JIRA    = 'jira';
    const AUTH_METHOD_REDMINE = 'redmine';
    const AUTH_METHOD_CONFIG  = 'config';
uyga@greybox ~/dev/codeisok (master) $

Particular method of authorisation is set in .config/gitphp.conf.php file.

uyga@greybox ~/dev/codeisok (master) $ grep '\GitPHP_Config::AUTH_METHOD' .config/gitphp.conf.php
     * Authentication method to use. See \GitPHP_Config::AUTH_METHOD_* constants to get list of supported methods
    \GitPHP_Config::AUTH_METHOD             => \GitPHP_Config::AUTH_METHOD_CONFIG,
uyga@greybox ~/dev/codeisok (master) $

By default after installation the auth method is AUTH_METHOD_CONFIG. You can choose one the best for you according to options below.

Options

  1. AUTH_METHOD_NONE - no authorisation is required.
  2. AUTH_METHOD_CROWD - authorise trough Atlassian Crowd service. To make this method working you have to:
    • Set \GitPHP_Config::AUTH_METHOD to \GitPHP_Config::AUTH_METHOD_CROWD value in .config/gitphp.conf.php file;
    • Set \GitPHP_Config::CROWD_URL and \GitPHP_Config::CROWD_APP_TOKEN constants in .config/gitphp.conf.php file.
  3. AUTH_METHOD_JIRA - authorise trough Atlassian Jira REST API. To make this method working you have to:
    • Set \GitPHP_Config::AUTH_METHOD to \GitPHP_Config::AUTH_METHOD_JIRA value in .config/gitphp.conf.php file;
    • Set \GitPHP_Config::JIRA_URL, \GitPHP_Config::JIRA_USER and \GitPHP_Config::JIRA_PASSWORD to appropriate values in .config/gitphp.conf.php file.
  4. AUTH_METHOD_REDMINE - authorise trough Redmine REST API. To make this method working you have to:
    • Set \GitPHP_Config::AUTH_METHOD to \GitPHP_Config::AUTH_METHOD_REDMINE value in .config/gitphp.conf.php file;
    • Set Redmine url and API key in this file:
uyga@greybox ~/dev/codeisok (master) $ grep 'const' .include/Redmine.php
    const API_KEY = '';
    const URL = 'https://your.redmine.url/';
uyga@greybox ~/dev/codeisok (master) $
  1. AUTH_METHOD_CONFIG - single user/password is set in config file as a plain text. This is default authorisation method after installation. To set you preferred name/password you should change \GitPHP_Config::CONFIG_AUTH_USER values in .config/gitphp.conf.php file:
uyga@greybox ~/dev/codeisok (master) $ grep '\GitPHP_Config::CONFIG_AUTH_USER' .config/gitphp.conf.php
     \GitPHP_Config::CONFIG_AUTH_USER => ['name' => 'user', 'password' => 'password', 'admin' => true],
uyga@greybox ~/dev/codeisok (master) $

'admin' => true value means this user has administration section enabled in the interface after login.