GithubHelp home page GithubHelp logo

os2sandbox / faellekommunal_organisation_rest_api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from itk-dev/serviceplatformen_organisation_api

0.0 0.0 0.0 110 KB

This project contains a containerized service that acts as a bridge between digitaliseringskataloget.dk/integration/sf1500 and a modern REST API.

PHP 99.81% Twig 0.19%

faellekommunal_organisation_rest_api's Introduction

OS2Forms Organisation API

About the project

Sets up an API with data from Serviceplatformen Organisation.

Built with

Getting started

To get a local copy up and running follow these steps.

Installation

  1. Clone the repo

    git clone [email protected]:itk-dev/os2forms_organisation_api.git
  2. Pull docker images and start docker containers

    docker compose pull
    docker compose up --detach
  3. Install composer packages

    docker compose exec phpfpm composer install
  4. Run database migrations

    docker compose exec phpfpm bin/console doctrine:migrations:migrate --no-interaction

You should now be able to browse to the application

open "http://$(docker compose port nginx 8080)"

and the api

open "http://$(docker compose port nginx 8080)/api"

Configuration

###> serviceplatformen ###
# Certificate options
SF1500_ORGANISATION_CERTIFICATE_LOCATOR_TYPE=APP_SF1500_ORGANISATION_CERTIFICATE_LOCATOR_TYPE
# LOCATOR_TYPE Should be 'azure_key_vault' or 'file_system'.
SF1500_ORGANISATION_CERTIFICATE_PATH=APP_SF1500_ORGANISATION_CERTIFICATE_PATH
SF1500_ORGANISATION_CERTIFICATE_TENANT_ID=APP_SF1500_ORGANISATION_CERTIFICATE_TENANT_ID
SF1500_ORGANISATION_CERTIFICATE_APPLICATION_ID=APP_SF1500_ORGANISATION_CERTIFICATE_APPLICATION_ID
SF1500_ORGANISATION_CERTIFICATE_CLIENT_SECRET=APP_SF1500_ORGANISATION_CERTIFICATE_CLIENT_SECRET
SF1500_ORGANISATION_CERTIFICATE_NAME=APP_SF1500_ORGANISATION_CERTIFICATE_NAME
SF1500_ORGANISATION_CERTIFICATE_SECRET=APP_SF1500_ORGANISATION_CERTIFICATE_SECRET
SF1500_ORGANISATION_CERTIFICATE_VERSION=APP_SF1500_ORGANISATION_CERTIFICATE_VERSION
SF1500_ORGANISATION_CERTIFICATE_PASSPHRASE=APP_SF1500_ORGANISATION_CERTIFICATE_PASSPHRASE
# Other options
SF1500_ORGANISATION_AUTHORITY_CVR=APP_SF1500_ORGANISATION_AUTHORITY_CVR
SF1500_ORGANISATION_STS_APPLIES_TO=APP_SF1500_ORGANISATION_STS_APPLIES_TO
SF1500_ORGANISATION_TEST_MODE=APP_SF1500_ORGANISATION_TEST_MODE
SF1500_ORGANISATION_MANAGER_ROLE_UUID_TEST=APP_SF1500_ORGANISATION_MANAGER_ROLE_UUID_TEST
SF1500_ORGANISATION_MANAGER_ROLE_UUID_PROD=APP_SF1500_ORGANISATION_MANAGER_ROLE_UUID_PROD
###< serviceplatformen ###

Commands

Fetch data

To fetch data from SF1500 run

docker compose exec phpfpm bin/console doctrine:database:drop --force
docker compose exec phpfpm bin/console doctrine:database:create
docker compose exec phpfpm bin/console doctrine:migrations:migrate --no-interaction
docker compose exec phpfpm bin/console organisation:fetch:data

Model data

Models data currently in database. This is done to decrease number of calls needed when requesting specific data.

API

Search for users by name

curl -X 'GET' \
  'https://os2forms_organisation_api.local.itkdev.dk/api/v1/bruger?page=1&navn=Jeppe%20Kuhlmann' \
  -H 'accept: application/ld+json'

Search parameters

Get info on user

curl -X 'GET' \
  'https://os2forms_organisation_api.local.itkdev.dk/api/v1/bruger/ffdb7559-2ad3-4662-9fd4-d69849939b66' \
  -H 'accept: application/ld+json'

Get funktioner

curl -X 'GET' \
  'https://os2forms_organisation_api.local.itkdev.dk/api/v1/bruger/ffdb7559-2ad3-4662-9fd4-d69849939b66/funktioner' \
  -H 'accept: application/ld+json'

Coding standard tests

The following commands let you test that the code follows the coding standards we decided to adhere to in this project.

  • PHP files (PHP-CS-Fixer with the Symfony ruleset enabled)

    docker compose exec phpfpm vendor/bin/php-cs-fixer fix --dry-run

faellekommunal_organisation_rest_api's People

Contributors

jekuaitk avatar

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.