Skip to content

This project compines Gatekeeper, Valet Key and Static Content Hosting patterns using Azure Storage emulator.

License

Notifications You must be signed in to change notification settings

aggstam/azure-design-patterns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

azure-design-patterns

This project compines Gatekeeper, Valet Key and Static Content Hosting patterns using Azure Storage emulator.

The basic functionality of the project is to provide remote storage actions for a picture repository site, along with user database and share links for the images.

Two REST APIs exist, one for the Gatekeeper(Gateway) and one for the Backend.
Gatekeeper API exposes the public URLs of the application, performs requests validation and forward each valid request to Backend to be processed.
BackEnd API execute request processing and have access to Database for user authentication/creation and Azure Storage for file actions.

Prerequisites

  • ASP.NET Core(C#) v3.1
  • MongoDB v4.2.8
  • Microsoft Azure Storage Emulator v5.10

Place secrets.json under UserSercrets folder:

C:\Users\<user>\AppData\Roaming\Microsoft\UserSecrets\<app_id>

Initialize MongoDB with project data folder:

% mongod --dbpath <path_to_folder>\azure-design-patterns\BackEnd\database\UsersData

To generate users execute the following commands in MongoDB:

db.Users.insertMany(
    [
        {'FirstName':'','LastName':'','Email':'','Username':'gatekeeper','Password':'gatekeeper'},
        {'FirstName':'Aggelos','LastName':'Stamatiou','Email':'aggelos@gmail.com','Username':'aggelos','Password':'aggelos'},
        {'FirstName':'Giorgos','LastName':'Weider','Email':'giorgos@gmail.com','Username':'giorgos','Password':'giorgos'},
        {'FirstName':'Stavros','LastName':'Laios','Email':'stavros@gmail.com','Username':'stavros','Password':'stavros'}
    ]
)

Runtime notes

Both GateKeeper and BackEnd use HTTPS.
GateKeeper endpoints are public, while BackEnd are accessible only in local network.
Base Authentication is used on GateKeeper for User Authentication.
When a Gatekeeper service is requested:

  1. An authorization call to BackEnd is executed in order to verify user.
  2. If user is authorized, service is executed.

MongoDB is used to store Users information.
Azure local storage is used for content hosting.
Valet Keys are used in order to retrieve content from Azure local storage.
When a BackEnd service fails, HTTP status 500 is returned to GateKeeper.
You can find requests execution examples in requests_examples.txt.

About

This project compines Gatekeeper, Valet Key and Static Content Hosting patterns using Azure Storage emulator.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages