@@ -10,14 +10,10 @@ namespace DotNetNuke.Web.Api
1010 using DotNetNuke . Web . Api . Auth . ApiTokens ;
1111 using DotNetNuke . Web . Api . Auth . ApiTokens . Models ;
1212
13- /// <summary>
14- /// Attribute to authorize apis based on the api token used.
15- /// </summary>
13+ /// <summary>Attribute to authorize apis based on the api token used.</summary>
1614 public class ApiTokenAuthorizeAttribute : AuthorizeAttributeBase , IOverrideDefaultAuthLevel
1715 {
18- /// <summary>
19- /// Initializes a new instance of the <see cref="ApiTokenAuthorizeAttribute"/> class.
20- /// </summary>
16+ /// <summary>Initializes a new instance of the <see cref="ApiTokenAuthorizeAttribute"/> class.</summary>
2117 /// <param name="key">The Key to authenticate api.</param>
2218 /// <param name="resourceFile">The resource file for the token api.</param>
2319 /// <param name="scope">The required api token scope.</param>
@@ -28,29 +24,21 @@ public ApiTokenAuthorizeAttribute(string key, string resourceFile, ApiTokenScope
2824 this . Scope = scope ;
2925 }
3026
31- /// <summary>
32- /// Gets or sets the Key for the api token.
33- /// </summary>
34- public string Key { get ; set ; } = string . Empty ;
27+ /// <summary>Gets or sets the Key for the api token.</summary>
28+ public string Key { get ; set ; }
3529
36- /// <summary>
37- /// Gets or sets the resource file for the api token.
38- /// </summary>
39- public string ResourceFile { get ; set ; } = string . Empty ;
30+ /// <summary>Gets or sets the resource file for the api token.</summary>
31+ public string ResourceFile { get ; set ; }
4032
41- /// <summary>
42- /// Gets or sets the required api token scope.
43- /// </summary>
44- public ApiTokenScope Scope { get ; set ; } = ApiTokenScope . User ;
45-
46- [ Dependency ]
33+ /// <summary>Gets or sets the required api token scope.</summary>
34+ public ApiTokenScope Scope { get ; set ; }
35+
36+ [ Dependency ]
4737 private IApiTokenController ApiTokenController { get ; set ; }
4838
49- /// <summary>
50- /// Check if the request is authorized.
51- /// </summary>
39+ /// <summary>Check if the request is authorized.</summary>
5240 /// <param name="context">The authentication filter context.</param>
53- /// <returns>True if authorized, false otherwise.</returns>
41+ /// <returns><see langword="true"/> if authorized, <see langword=" false"/> otherwise.</returns>
5442 public override bool IsAuthorized ( AuthFilterContext context )
5543 {
5644 var token = this . ApiTokenController . GetCurrentThreadApiToken ( ) ;
0 commit comments