C# Class com.microsoft.dx.officewopi.Utils.WopiUtil

显示文件 Open project: OfficeDev/PnP-WOPI Class Usage Examples

Public Methods

Method Description
GetActionUrl ( WopiAction action, FileModel file, string authority ) : string

Forms the correct action url for the file and host

GetDiscoveryInfo ( ) : Task>

Gets the discovery information from WOPI discovery and caches it appropriately

PopulateActions ( this file ) : System.Threading.Tasks.Task

Populates a file with action details from WOPI discovery based on the file extension

PopulateActions ( this files ) : System.Threading.Tasks.Task

Populates a list of files with action details from WOPI discovery

ValidateWopiProof ( HttpContext context ) : Task

Validates the WOPI Proof on an incoming WOPI request

Private Methods

Method Description
getWopiProof ( HttpContext context ) : Task

Gets the WOPI proof details from the WOPI discovery endpoint and caches it appropriately

verifyProof ( byte expectedProof, string proofFromRequest, string proofFromDiscovery ) : bool

Verifies the proof against a specified key

Method Details

GetActionUrl() public static method

Forms the correct action url for the file and host
public static GetActionUrl ( WopiAction action, FileModel file, string authority ) : string
action com.microsoft.dx.officewopi.Models.Wopi.WopiAction
file com.microsoft.dx.officewopi.Models.FileModel
authority string
return string

GetDiscoveryInfo() public static method

Gets the discovery information from WOPI discovery and caches it appropriately
public static GetDiscoveryInfo ( ) : Task>
return Task>

PopulateActions() public static method

Populates a file with action details from WOPI discovery based on the file extension
public static PopulateActions ( this file ) : System.Threading.Tasks.Task
file this
return System.Threading.Tasks.Task

PopulateActions() public static method

Populates a list of files with action details from WOPI discovery
public static PopulateActions ( this files ) : System.Threading.Tasks.Task
files this
return System.Threading.Tasks.Task

ValidateWopiProof() public static method

Validates the WOPI Proof on an incoming WOPI request
public static ValidateWopiProof ( HttpContext context ) : Task
context System.Web.HttpContext
return Task