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
Adds application permission check on certain command groups / specific commands #5862
Conversation
Thank you, we'll try to review it ASAP |
Could you fix the merge conflicts, please? |
b437ed1
to
da45f2e
Compare
@MathijsVerbeeck could you fix the merge conflicts again? |
da45f2e
to
6edce03
Compare
Could you resolve the merge conflicts @MathijsVerbeeck? |
6edce03
to
8f0ceed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start @MathijsVerbeeck, made a few comments while reviewing. Could you have a look at them, please?
A few comments apply to all tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do some more changes. It seems like you missed some of my previous comments, or they were not clear enough. If the latter, sorry for that, you can always ask more context.
Another thing, currently we have a lot of files (pa, pp, flow, ...) where we stub the wrong function. Right now we do:
sinon.stub(accessToken, 'isAppOnlyAccessToken').returns(false);
auth.connection.accessTokens[auth.defaultResource] = {
expiresOn: 'abc',
accessToken: 'abc'
};
While in fact, we should just stub the assertDelegatedAccessToken
function.
Sorry for the inconvenience... I had some merge issues on my laptop and decided, instead of fixing them, to work on a clean branch on my desktop, which is why I must've messed up some of the comments you had already given. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're getting there, let's do a few more changes to get it on point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from a few tiny changes, I think it's good to go! Awesome work!
}, | ||
|
||
/** | ||
* Asserts the presence of a delegated access token and checks if it is not an app-only token. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Asserts the presence of a delegated access token and checks if it is not an app-only token. | |
* Asserts the presence of a delegated access token. |
@@ -27,10 +29,17 @@ describe('PowerPlatformCommand', () => { | |||
|
|||
before(() => { | |||
sinon.stub(telemetry, 'trackEvent').returns(); | |||
sinon.stub(accessToken, 'isAppOnlyAccessToken').returns(false); | |||
auth.connection.accessTokens[auth.defaultResource] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add auth.connection.active = true;
Merged manually, thank you for this addition! 👏 |
Closes #4054
Quite a big one, so a little summary below :-)
Command groups:
Specific commands
outlook message move
teams chat send