Giter Site home page Giter Site logo

whanganuihigh / kamar-directory-service Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 2.0 272 KB

An example kamar directory service using Laravel. Use this as a starting point for your next Kamar Directory Service

Shell 1.02% PHP 82.63% JavaScript 0.23% Blade 16.12%
directory-service kamar laravel service listening-service directory

kamar-directory-service's Introduction

KAMAR Directory Service Example

Initial Configuration

Copy the .env.example to .env and set the values for:

  • KAMAR_DS_USERNAME Your Directory Service Username
  • KAMAR_DS_PASSWORD Your Directory Service Password
  • KAMAR_DS_FORMAT Your Directory Service Format (json|xml)

Do not set Username and Password values in the config file.

Set the values in /config/kamar.php for:

  • serviceName e.g. "Kamar Directory Service"
  • serviceVersion e.g. 1.0
  • infoUrl e.g. "https://www.myschool.co.nz/more-info"
  • privacyStatement e.g. "Change this to a valid privacy statement | All your data belongs to us and will be kept in a top secret vault."
  • options The options to be requested for your directory service

Routes

A single route is defined in /app/routes/kamar.php accepting POST requests to /kamar.
The route is handled by /app/Http/Controllers/HandleKamarPost.php.
Base functionality as described in the KAMAR example is implemented here, but you are free to adjust to suit your requirements.

Middleware

A new kamar middleware group is created in /app/Http/Kernel.php.
The group is the same as the default web group, but has the csrf middleware removed.
You MUST make sure you are authenticating requests to your application.

Storage

The example implementation will write json data files at /storage/app/data. These files are not publicly accessible by default.

Commands & Schedules

A RemoveOldDataFiles command is available that will remove files older than 3 days. A schedule to run the command daily is also configured (/app/Console/Kernel.php)

Run the command manually with php artisan KamarDS:removeOldDataFiles, or configure a cron job to run the task as per the schedule.

For information on configuring a schedule, see https://laravel.com/docs/9.x/scheduling#running-the-scheduler

Testing

Run tests with php artisan test

KAMAR Directory Services Documentation

See https://directoryservices.kamar.nz/ for implementation details.

kamar-directory-service's People

Contributors

wing5wong avatar

Watchers

 avatar  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.