GithubHelp home page GithubHelp logo

zalando-stups / kio Goto Github PK

View Code? Open in Web Editor NEW
23.0 16.0 11.0 361 KB

The application registry in the STUPS ecosystem

Home Page: http://docs.stups.io/en/latest/components/kio.html

License: Other

Clojure 98.14% Dockerfile 0.89% Shell 0.97%
application-registry

kio's Introduction

Kio

Build Status

Kio is the application registry in the STUPS ecosystem. It manages the basic information about an organisation’s applications.

Download

Releases are pushed as Docker images in the public Docker registry:

You can run Kio by starting it with Docker:

$ docker run -it stups/kio

Requirements

  • PostgreSQL 9.3+

Configuration

Configuration is provided via environment variables during start.

Variable Default Description
HTTP_PORT 8080 TCP port to provide the HTTP API.
HTTP_CORS_ORIGIN Domain for cross-origin JavaScript requests. If set, the Access-Control headers will be set.
DB_SUBNAME //localhost:5432/kio JDBC connection information of your database.
DB_USER postgres Database user.
DB_PASSWORD postgres Database password.

Example:

$ docker run -it \
    -e HTTP_CORS_ORIGIN="*.zalando.de" \
    -e DB_USER=kio \
    -e DB_PASSWORD=kio123 \
    stups/kio

Building

$ lein uberjar
$ lein docker build

Releasing

$ lein release :minor

Developing

Kio embeds the reloaded workflow for interactive development:

$ lein repl
user=> (go)
user=> (reset)

License

Copyright © 2015 Zalando SE

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

kio's People

Contributors

aermakov-zalando avatar amosciatti avatar dryewo avatar ethercrow avatar gowind avatar hjacobs avatar jmcs avatar juhmelo avatar kgalli avatar linki avatar maxim-tschumak avatar mikkeloscar avatar mrandi avatar neremic avatar prayerslayer avatar rafaelcaricio avatar sarnowski avatar scherniavsky avatar sebastianpoeplau avatar thilp avatar tkrop avatar traumeel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kio's Issues

Wrong team is compared

When updating an application, the team contained in the payload is used for authorization. It should be the team in the database.

Support audit criticality levels for application

Each application should have an audit criticality level 1, 2 or 3.
1: Not audit relevant
2: Audit relevant
3: PCI

The criticality level defines the number of required approvers (Level 1 -> 1 Approver, Level 2 and 3 -> 2 approvers)

The default value for each new application is 2. Only a few people should be able to change this.

implement caching

Currently any "u/require-internal-user request" results in a call to the users api, this means for some parts in yourturn the users api is called at least 10-20 times in a second for the same data.

Extend [/apps] endpoint to return only apps registered after a certain timestap

zalando/kontrolletti#12 Is a job responsible for importing scm-url's from new applications registered with zalando-stups/kio.
Can you extend the /apps-endpoint to accept a timestamp filter parameter such that we could request only for applications registered/updated after a certain time?
The result should only contain apps that were updated or created after the passed timestampparameters.

Extend returned App model with scm_url in [/apps] endpoint

Right now to retrieve all the SCM-URL's from zalando-stups/kio we need to call 2 endpoints.

  • First we call /apps which includes all the id's of all applications.
  • Second we call /apps/id for each id we got on the first call.

It would be great if zalando/kontrolletti#60 could call /apps endpoint once to get all registered SCM-url's in the App json-object.
Is it possible to extend the returned json object to include the scm-url and time-created?

Kio search errror

When the search contains spaces, kio throw an error.

GET https://kio.address/apps?search="ab"

GET https://kio.address/apps?search="a b"

Applications & Components: required changes

To accommodate Zalando's new Applications & Components definition, the following changes are needed in the Kio application registry:

  • Remove the obsolete/unused required_approvers field
  • Remove the obsolete/unused criticality_level field
  • Remove the obsolete/unused specification_type field
  • Remove the publicly_accessible field as it lost its purpose
  • Remove the scm_url field as it lost its purpose (application components can come from multiple git repos)
  • Migrate/rename the field service_url to url as it now denotes the main (production) application URL, e.g. for UI web apps. The field stays optional.
  • Add a new field incident_contact to denote the responsible 24x7 team (#99)

Load Testing fields in Kio/Yourturn

As we agreed in email, we would like to add 2 more fields in Kio/Yourturn about Load Testing.
Field # 1 “Link to load test scripts”
Which can have one of 3 values:

  1. not yet: The application must be load tested, but they do not have a load testing tool yet.

  2. doesn't apply: The application doesn't need to be load tested, e.g. native application.
  3. {Load_test_artefacts_URL}: GHE link to load test script when using scripted load testing tool / GHE link to load test configuration files when using non-scripted tool / link to internal docs that explain how to run those load tests when using a non-scripted tool.

screen shot 2017-06-26 at 16 33 14

Field # 2 “Request Per Second (RPS)”
Will be added for each git revision id / docker image tag git rev-parse HEAD | cut -c-10 meaning git rev id 671ee80c08 and can handle 80 RPS
screen shot 2017-06-26 at 16 04 16

Improve logging for approvals

Right now, we only log which use, approves which application in which version but we do not know which kind of approval was given.

Improve logging

...especially for the authorization logic, which is really complex:

(defn require-write-authorization
  "If user is employee, check that is in correct team.
   If user is service, check that it has application_write.all scope OR has application.write and is correct team"
  [request team]
  (require-uid request)
  (let [has-auth? (auth/get-auth request team)
        realm (from-token request "realm")
        is-robot? (= "/services" realm)
        is-human? (= "/employees" realm)
        has-scope? (set (from-token request "scope"))]
    (if is-human?
      (when-not has-auth?
        (api/throw-error 403 "Unauthorized")))
    (if is-robot?
      (if-not (has-scope? "application.write_all")
        (when-not (and
                    (has-scope? "application.write")
                    has-auth?)
          (api/throw-error 403 "Unauthorized"))
        (require-special-uid request)))))

Use magnificent via friboo

Instead of fetching teams by itself, Kio should just use the central auth server "magnificent" via Friboo.

Support release stages workflow

As Release-engineer
I want reduce redundant steps while deploying new version on release stage
So that reduce deploy time for new version on release stage and keep me audit compliant

Currently every single time when I deploy release stage I could receive a lot of violations:

  • APPLICATION_VERSION_NOT_PRESENT_IN_KIO
  • MISSING_VERSION_APPROVAL
  • VERSION_APPROVAL_NOT_ENOUGH
  • EC2_WITH_A_SNAPSHOT_IMAGE

To be audit compliant I should have no violations at all.

To deploy new version into release stage without violations I should:

  • Manually create a version
  • Approve the version version
  • Ask at least one colleague to approve the version
  • Make a deployment
  • Go to violations and resolve EC2_WITH_A_SNAPSHOT_IMAGE manually

Unfortunately, only one of these steps makes sense for release stages

Produce only violations that make sense

As Deploy engineer
I want to see violations that make sense
So that reduce violations count and make process much cleaner

Currently I could receive these violations together:

  • MISSING_VERSION_APPROVAL
  • VERSION_APPROVAL_NOT_ENOUGH

Unfortunately second one has no matter if first one already presented

Query argument mismatch

java.lang.AssertionError: Assert failed: Query argument mismatch.
Expected keys: (:description :documentation_url :specification_url :publicly_accessible :service_url :name :criticality_level :scm_url :last_modified_by :active :id :subtitle :team_id :created_by :specification_type)
Actual keys: (:description :documentation_url :specification_url :publicly_accessible :service_url :name :scm_url :last_modified_by :active :id :subtitle :team_id :created_by :specification_type)
Missing keys: (:criticality_level)

Allow a robot user to make and approve new versions

Our team would like to fully automate our continuous delivery process. At the moment Kio API doesn't allow robot user (our Jenkins robot user) with realm "services" to make and approve new versions in Kio. Would be nice to have this ability.

Allow changes from robot users

If user is an employee: Check that it is in correct team. If user is a robot: Check that is has application.write_all scope.

Allow read access for employees without team

Read access to the Kio API should also be possible for users that are not in any team.

(require-internal-user) should be replaced with (require-realms ["employees" "services"])

Add field "24x7 Contact"

A new field "24x7 Contact" (actual field name to be discussed) should be added to allow finding the 24x7 on-call team responsible for the application.

Remove field specification_type

We already have the field specification_url, therefore we can easily infer the specification type (e.g. GitHub issues, JIRA, ..).

Increase Hystrix timeouts

The default timeout period of one second is too short and leads to 503 response status occurring very often.

I suggest to increase it to 1.5 or 2 seconds and see if it helps.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.