Private
Public Access
1
0
Files
Kordophone/kordophone/Bridge/Operations/MBIMBridgeOperation.h
James Magahern 4d51ba7dd2 Auth: adds JWT bearer auth via /authenticate.
Works in addition to digest auth
2021-07-06 22:52:33 -07:00

40 lines
1.2 KiB
Objective-C

//
// MBIMBridgeOperation.h
// kordophoned
//
// Created by James Magahern on 11/13/18.
// Copyright © 2018 James Magahern. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CocoaHTTPServer/HTTPResponse.h>
#import <CocoaHTTPServer/HTTPErrorResponse.h>
#import "MBIMJSONDataResponse.h"
NS_ASSUME_NONNULL_BEGIN
typedef void (^MBIMBridgeOperationCompletionBlock)(NSObject<HTTPResponse> * _Nullable response);
@interface MBIMBridgeOperation : NSOperation
@property (class, nonatomic, readonly) NSString *endpointName;
@property (class, nonatomic, readonly) BOOL requiresAuthentication; // default YES
@property (nonatomic, strong) NSData *requestBodyData;
@property (nonatomic, readonly) NSURL *requestURL;
@property (nonatomic, readonly) MBIMBridgeOperationCompletionBlock serverCompletionBlock;
+ (dispatch_queue_t)sharedIMAccessQueue;
+ (nullable Class)operationClassForEndpointName:(NSString *)endpointName;
- (instancetype)initWithRequestURL:(NSURL *)requestURL completion:(MBIMBridgeOperationCompletionBlock)completionBlock;
- (NSObject<HTTPResponse> *)cancelAndReturnTimeoutResponse;
// convenience
- (nullable NSString *)valueForQueryItemWithName:(NSString *)queryItemName;
@end
NS_ASSUME_NONNULL_END