forked from d-titusgicheru/microsoft-graph-explorer-api
-
Notifications
You must be signed in to change notification settings - Fork 0
AB#38714 Set up end point for graph explorer application mode proxy #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
omersayshi
merged 4 commits into
interns/feature/ge-app-mode-proxy-endpoint
from
interns/omersayshi/38714-app-mode-endpoint
Jul 21, 2021
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
GraphExplorerAppModeService/GraphExplorerAppModeService.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk.Worker"> | ||
|
|
||
| <PropertyGroup> | ||
| <TargetFramework>net5.0</TargetFramework> | ||
| <UserSecretsId>dotnet-GraphExplorerAppModeService-10DEC1C0-DF4C-4EA8-B0A8-54951DB93792</UserSecretsId> | ||
| <OutputType>Library</OutputType> | ||
| </PropertyGroup> | ||
|
|
||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.Extensions.Hosting" Version="5.0.0" /> | ||
| </ItemGroup> | ||
| </Project> |
12 changes: 12 additions & 0 deletions
12
GraphExplorerAppModeService/Interfaces/IGraphAppAuthProvider.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace GraphExplorerAppModeService.Interfaces | ||
| { | ||
| interface IGraphAppAuthProvider | ||
| { | ||
| } | ||
| } |
12 changes: 12 additions & 0 deletions
12
GraphExplorerAppModeService/Interfaces/IGraphServiceClient.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace GraphExplorerAppModeService.Interfaces | ||
| { | ||
| interface IGraphServiceClient | ||
| { | ||
| } | ||
| } |
19 changes: 19 additions & 0 deletions
19
GraphExplorerAppModeService/Services/GraphAppAuthProvider.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| using GraphExplorerAppModeService.Interfaces; | ||
| using Microsoft.Extensions.Configuration; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
|
|
||
|
|
||
| namespace GraphExplorerAppModeService.Services | ||
| { | ||
| public class GraphAppAuthProvider : IGraphAppAuthProvider | ||
| { | ||
| public GraphAppAuthProvider(IConfiguration configuration) | ||
| { | ||
|
|
||
| } | ||
| } | ||
| } |
18 changes: 18 additions & 0 deletions
18
GraphExplorerAppModeService/Services/GraphClientService.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Text; | ||
| using System.Threading.Tasks; | ||
| using GraphExplorerAppModeService.Interfaces; | ||
| using Microsoft.Extensions.Configuration; | ||
|
|
||
| namespace GraphExplorerAppModeService.Services | ||
| { | ||
| class GraphClientService : IGraphServiceClient | ||
| { | ||
| public GraphClientService(IConfiguration configuration) | ||
| { | ||
|
|
||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| using System; | ||
| using Microsoft.AspNetCore.Mvc; | ||
| using Microsoft.AspNetCore.Authorization; | ||
| using Microsoft.AspNetCore.Http; | ||
| using GraphExplorerAppModeService.Interfaces; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using System.Threading.Tasks; | ||
|
|
||
| namespace GraphWebApi.Controllers | ||
| { | ||
| [ApiController] | ||
| public class GraphExplorerAppModeController : ControllerBase | ||
| { | ||
| [Route("api/[controller]/{*all}")] | ||
| [Route("graphproxy/{*all}")] | ||
| [HttpGet] | ||
| public async Task<IActionResult> GetAsync(string all, [FromHeader] string Authorization) | ||
| { | ||
| return await ProcessRequestAsync("GET", all, null, Authorization).ConfigureAwait(false); | ||
| } | ||
|
|
||
| [Route("api/[controller]/{*all}")] | ||
| [Route("graphproxy/{*all}")] | ||
| [HttpPost] | ||
| public async Task<IActionResult> PostAsync(string all, [FromBody] object body, [FromHeader] string Authorization) | ||
| { | ||
| return await ProcessRequestAsync("POST", all, body, Authorization).ConfigureAwait(false); | ||
| } | ||
|
|
||
| [Route("api/[controller]/{*all}")] | ||
| [Route("graphproxy/{*all}")] | ||
| [HttpDelete] | ||
| public async Task<IActionResult> DeleteAsync(string all, [FromHeader] string Authorization) | ||
| { | ||
| return await ProcessRequestAsync("DELETE", all, null, Authorization).ConfigureAwait(false); | ||
| } | ||
|
|
||
| [Route("api/[controller]/{*all}")] | ||
| [Route("graphproxy/{*all}")] | ||
| [HttpPut] | ||
| public async Task<IActionResult> PutAsync(string all, [FromBody] object body, [FromHeader] string Authorization) | ||
| { | ||
| return await ProcessRequestAsync("PUT", all, body, Authorization).ConfigureAwait(false); | ||
| } | ||
|
|
||
| [Route("api/[controller]/{*all}")] | ||
| [Route("graphproxy/{*all}")] | ||
| [HttpPatch] | ||
| public async Task<IActionResult> PatchAsync(string all, [FromBody] object body, [FromHeader] string Authorization) | ||
| { | ||
| return await ProcessRequestAsync("PATCH", all, body, Authorization).ConfigureAwait(false); | ||
| } | ||
|
|
||
| private async Task<IActionResult> ProcessRequestAsync(string method, string all, object content, string Authorizaton) | ||
| { | ||
|
|
||
| return Ok(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.