Giter Club home page Giter Club logo

activedirectory's Introduction

Active Directory Service

This web service is an http wrapper over basic LDAP calls to the Microsoft Active Directory service, I mostly use it on clients for quick onsite domain discovery.

Ci Status Branch
Azure Pipelines Build Status master
Github Actions .NET master

Known Challenges & Issues

Some requests to the LDAP can be costly and take a few seconds, to mitigate this scenario an in-memory cache has been included to help with recurring requests.

  • Use https for prod usage, since the content of these operations is highly sensitive in nature.

Configurations

Some configurations that are included on the appsettings are:

  1. Domains - Optional: if left empty, it will pick the current domain where the service is running. If multiple domains are defined on the Domains array, the endpoint will make requests to all of them. This was a very specific scenario that a client had.
  2. Addresses - Optional: if left empty the current host is selected. Urls defined here, will be used as endpoints on the open ui page for validation.
  3. Route Definition - Required: These values are attached to the openapi declaration and are needed for the defined metadata info
    1. Route Suffix - The path where the swagger json will be shown.
    2. Version - The swagger.json file version.
  4. Cache Configurations - Required: Cache Enabled flag that will enable/disable the cache. If enabled, the following keys must be populated.
    1. Cache Max Size - the maximum size in bytes of each cached response
    2. Cache Timespan - the time in seconds that the value will be kept alive on the cache store
    3. Cache Enabled - boolean to activate or deactivate cache on startup

The current appsettings.json can be configured manually:

{
  "Serilog": {
    "Using": [ "Serilog.Sinks.Console" ],
    "MinimumLevel": "Information",
    "WriteTo": [
      { "Name": "Console" }
    ],
    "Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ],
  },
  "AllowedHosts": "*",
  "AppSettings": {
    "Cache": {
      "CacheTimespan": 60,
      "CacheMaxSize": 2048,
      "CacheEnabled": true
    },
    "RouteDefinition": {
      "RouteSuffix": "/swagger",
      "Version": "v1"
    },
    "Domains": [
      ""
    ],
    "Addresses": [
      ""
    ]
  }
}

Health Check Feature

The endpoint of root/healthcheck for each requests includes a json heartbeat to determine if the service is online. This was done using the library of Microsoft.Extensions.Diagnostics.HealthChecks for more information check the github repo.

OpenApi

The OpenApi version used is Version 3.0.1

Dependencies & Libraries

This project targets net 8.0. For previous versions, check the tags. The following oss libraries are used on this repo as dependencies:

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.