Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
b8845d6
Merge pull request #598 from microsoftgraph/dev
MaggieKimani1 Jun 9, 2021
dae70db
Merge pull request #606 from microsoftgraph/dev
irvinesunday Jun 15, 2021
19fdb7c
Merges dev into master (#617)
MaggieKimani1 Jun 23, 2021
ab21557
Use null-conditionals when capturing count of enumerables
irvinesunday Jun 29, 2021
8d8da95
Subtle change to trigger build
irvinesunday Jun 30, 2021
7fe617a
Merge pull request #623 from microsoftgraph/fix/is/include-null-condi…
irvinesunday Jul 1, 2021
39f44e7
Revert metadata source
irvinesunday Jul 1, 2021
3828ef3
Merge pull request #624 from microsoftgraph/fix/is/revert-metadata-so…
irvinesunday Jul 1, 2021
a49e17a
Merges dev into master (#617) (#626)
irvinesunday Jul 5, 2021
c17c1c7
Merge branch 'master' into dev
andrueastman Jul 5, 2021
359b96e
Merge pull request #625 from microsoftgraph/dev
irvinesunday Jul 5, 2021
357bd80
Fix: Revert explode value to false in operation parameters (#621)
irvinesunday Jul 5, 2021
f28bb50
Merge branch 'master' into dev
irvinesunday Jul 5, 2021
86727cf
Merge pull request #627 from microsoftgraph/dev
irvinesunday Jul 5, 2021
1b0eb8b
Update PermissionsStore class (#622)
MaggieKimani1 Jul 7, 2021
a8eed5b
Merge branch 'master' into dev
irvinesunday Jul 7, 2021
ed4b4c1
Task: add GitHub templates (#634)
thewahome Jul 9, 2021
c0317db
Added .yml file for CI/CD pipeline on interns' fork
jerryxihe Jul 12, 2021
ac2f1ee
Set up CI with Azure Pipelines
jerryxihe Jul 12, 2021
512e5d9
Merge pull request #1 from LokiLabs/interns/jerryxihe/38984-added-azu…
jerryxihe Jul 12, 2021
58023a9
Bump Microsoft.AspNetCore.Authorization from 5.0.7 to 5.0.8
dependabot[bot] Jul 13, 2021
0003a64
Merge pull request #639 from microsoftgraph/dependabot/nuget/Microsof…
baywet Jul 13, 2021
3022c38
Bump Microsoft.AspNetCore.Mvc.NewtonsoftJson from 5.0.7 to 5.0.8
dependabot[bot] Jul 13, 2021
0d3174a
Merge pull request #640 from microsoftgraph/dependabot/nuget/Microsof…
baywet Jul 13, 2021
e8a133c
Bump Microsoft.AspNetCore.Authentication.JwtBearer from 5.0.7 to 5.0.8
dependabot[bot] Jul 13, 2021
b245bf7
Revert "Set up CI with Azure Pipelines"
jerryxihe Jul 13, 2021
fb6c6b4
Merge pull request #642 from microsoftgraph/dependabot/nuget/Microsof…
baywet Jul 13, 2021
959a7b5
Fix: Get all distinct permissions (#636)
irvinesunday Jul 13, 2021
e4935ca
Bump Microsoft.Extensions.DependencyInjection from 5.0.1 to 5.0.2
dependabot[bot] Jul 13, 2021
78ec6b8
Merge pull request #641 from microsoftgraph/dependabot/nuget/Microsof…
baywet Jul 13, 2021
9136d0f
Merge pull request #2 from LokiLabs/interns/38984-add-pipeline-for-in…
jerryxihe Jul 13, 2021
84a1f36
Merge branch 'microsoftgraph:dev' into interns/dev
acchiang Jul 14, 2021
ba95e6c
Renamed interns .yml
jerryxihe Jul 13, 2021
16444e2
Renamed interns pipeline .yml to accurately reflect its use
jerryxihe Jul 15, 2021
779ce91
Merge pull request #5 from LokiLabs/revert-1-interns/jerryxihe/38984-…
jerryxihe Jul 15, 2021
eca9e45
Merge pull request #7 from LokiLabs/interns/jerryxihe/38984-change-in…
jerryxihe Jul 15, 2021
4b402c6
AB#38984 Merging interns pipeline .yml into LokiLabs/dev (#8)
jerryxihe Jul 15, 2021
151fc60
Added `master` and `dev` to interns pipeline triggers
jerryxihe Jul 15, 2021
4ac9ef9
Merge branch 'dev' into interns/dev
jerryxihe Jul 15, 2021
5f0f758
omersayshi Jul 20, 2021
d60609a
Fixed small error
omersayshi Jul 20, 2021
e99db79
Merge branch 'interns/dev' into interns/omersayshi/39171-app-mode-sam…
omersayshi Jul 20, 2021
44611b2
Fixed another small typo
omersayshi Jul 21, 2021
9474f45
Merge pull request #13 from LokiLabs/interns/omersayshi/39171-app-mod…
omersayshi Jul 27, 2021
a924fc0
Added ownership check functions
omersayshi Jul 27, 2021
79c0986
Finalized tenant and client id retrieval from token
omersayshi Jul 28, 2021
9d70e8f
Cleanup
omersayshi Jul 28, 2021
da84f62
Merge remote-tracking branch 'origin/interns/dev' into interns/omersa…
omersayshi Aug 3, 2021
0e43543
omersayshi Aug 4, 2021
294cdbd
Added PR changes and fixed error to return JSON
omersayshi Aug 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can also add a section called actual behavior to understand the bug more easily and clearly

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are from an upstream merge and not mine, so I cant change it.

A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
20 changes: 20 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

## Overview

Brief description of what this PR does, and why it is needed.

### Demo

Optional. Screenshots, `curl` examples, etc.

### Notes

Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.

## Testing Instructions

* How to test this PR
* Prefer bulleted description
* Start after checking out this branch
* Include any setup required, such as bundling scripts, restarting services, etc.
* Include test case, and expected output
22 changes: 22 additions & 0 deletions GraphExplorerAppModeService/Interfaces/IGraphService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using Microsoft.Graph;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GraphExplorerAppModeService.Interfaces
{
/// <summary>
/// This class is for functions that call Microsoft Graph to check if the client owns the Teams resource they are trying to call against.
/// </summary>
public interface IGraphService
Comment thread
omersayshi marked this conversation as resolved.
{
/// <summary>
/// ErrorMessage will contain the error message from the Graph Client call.
/// </summary>
string ErrorMessage { get; set; }
Comment thread
omersayshi marked this conversation as resolved.

Task<bool> VerifyOwnership(GraphServiceClient graphClient, string query, string clientId);
}
}
12 changes: 0 additions & 12 deletions GraphExplorerAppModeService/Interfaces/IGraphServiceClient.cs

This file was deleted.

8 changes: 0 additions & 8 deletions GraphExplorerAppModeService/Services/GraphAppAuthProvider.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
using GraphExplorerAppModeService.Interfaces;
using Microsoft.Extensions.Configuration;
using Microsoft.Graph;
using Microsoft.Identity.Web;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http.Headers;
using System.Text;
using System.Threading.Tasks;


namespace GraphExplorerAppModeService.Services
{
Expand Down
18 changes: 0 additions & 18 deletions GraphExplorerAppModeService/Services/GraphClientService.cs

This file was deleted.

77 changes: 77 additions & 0 deletions GraphExplorerAppModeService/Services/GraphService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GraphExplorerAppModeService.Interfaces;
using Microsoft.Extensions.Configuration;
using Microsoft.Graph;
using Newtonsoft.Json;

namespace GraphExplorerAppModeService.Services
{
public class GraphService : IGraphService
{
private string errorMessage;

// Docs defined in IGraphService
public string ErrorMessage { get; set; }
Comment thread
omersayshi marked this conversation as resolved.

public async Task<bool> VerifyOwnership(GraphServiceClient graphClient, string query, string clientId)
{
string[] queryList = query.Split("/");

for (int i=0; i < queryList.Length; i++)
{
if (queryList[i] == "teams" && i + 1 < queryList.Length)
{
return await VerifyTeamsOwnership(graphClient, queryList[i + 1], clientId);
Comment thread
omersayshi marked this conversation as resolved.
} else if (queryList[i] == "chats" && i + 1 < queryList.Length)
{
return await VerifyChatOwnership(graphClient, queryList[i + 1], clientId);
}
}

return false;
}

private async Task<bool> VerifyTeamsOwnership(GraphServiceClient graphClient, string teamId, string clientId)
{
try
{
var owners = await graphClient.Groups[teamId].Owners.Request().GetAsync();

foreach (var owner in owners)
{
if (clientId == owner.Id) return true;
Comment thread
csyan5 marked this conversation as resolved.
}
}
catch (ServiceException e)
{
ErrorMessage = e.Message;
}

return false;
}

private async Task<bool> VerifyChatOwnership(GraphServiceClient graphClient, string chatId, string clientId)
{
try
{
var members = await graphClient.Chats[chatId].Members.Request().GetAsync();

foreach (AadUserConversationMember member in members)
{
if (clientId == member.UserId && member.Roles.Contains("owner")) return true;
}
}
catch (ServiceException e)
{
ErrorMessage = e.Message;
Comment thread
omersayshi marked this conversation as resolved.
}

return false;
}
}
}
Loading