Coder Social home page Coder Social logo

caapim / ios-mas-foundation Goto Github PK

View Code? Open in Web Editor NEW
15.0 46.0 21.0 21.02 MB

iOS Mobile SDK for CA Mobile API Gateway - MASFoundation Framework

Home Page: http://mas.ca.com

License: Other

Objective-C 99.45% C 0.55%
ios-sdk masfoundation-framework mas ios-mas-sdk

ios-mas-foundation's People

Contributors

abhisheknaidu-462 avatar belailovszky avatar bmckercher avatar bobbyweber avatar brendanmwoods avatar herrhound avatar jhoongo avatar kayliemoa avatar lsanches avatar mahithegeek avatar manutripathi82 avatar rodrigoareis avatar saglave avatar spetrov avatar ysd24 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ios-mas-foundation's Issues

issue sending special character like "&" or "+" for login

I am using MasFoundation framework in my app for certain reasons,
The library seems to for fine but has one issue while I am trying to use the login method i.e as stated in the documentation

  • (void)loginWithUserName:(NSString *_Nonnull)userName password:(NSString *_Nonnull)password completion:(MASCompletionErrorBlock _Nullable)completion;

I am using swift 4 however when I send passwords includind "&" and "+" in thier method, it gets truncated to before the characters and sends the half string

for eg if Password is "P&ssword", the server will only receive P in thier login request, however if password is "P@ssword", it will work perfectly

I tried using .addingPercentEncoding(withAllowedCharacters: ) but to no avail, Can anyone help?

CA Mobile SDK (MAG/MAS) - SNI Client Support

This is not an issue, just a question.

We are implementing MAS/MAG/RAS SDK at a customer, and to fulfill some networking infrastructure requirements (Firewall/WAF/Reverse Proxy...) our customer is asking if the "Mobile SDK for CA Mobile API Gateway" (https://mas.ca.com) supports SNI (Server Name Indication).

We couldn't find this information in the official documentation.

By our searches in the Official Documentation and CA Communities site, we believe that CA API Gateway (Server) does not have SNI support, but the question above is specific for the Mobile Client SDK (Android/iOS/etc).

SNI can be described as:

SNI stands for Server Name Indication and is an extension of the TLS protocol. It indicates which hostname is being contacted by the browser (client) at the beginning of the 'handshake'-process.
This allows a server to present multiple certificates on the same IP address and TCP port number and hence allows multiple secure websites to be served off the same IP address without requiring all those sites to use the same certificate.

What we want to know is:

In the above scenario (SNI-enabled server serving multiple HTTPS hosts), if a client using MAS SDK connects to this server, it will, during TLS handshake, provide server name information to the server, which, in turn, will present the righ SSL certificate to the SDK?

Meaning "does MAS SDK HTTP(S) Client Libraries supports and uses SNI by default?"

If the Mobile Client SDK supports SNI, we need to know if there is any limitation.

We already got an answer for the same question for the Android SDK (CAAPIM/Android-MAS-SDK#268)

Best Regards,

Marlos Chida

Fix CocoaPods - Published PodSpec should include other MASFoundation headers

The current published CocoaPod for MASFoundation is 1.2.01 and only includes references to MASFoundation.h:

https://raw.githubusercontent.com/CocoaPods/Specs/master/Specs/0/b/8/MASFoundation/1.2.01/MASFoundation.podspec.json

If you add "MASFoundation" to the podfile when using the MASStarter template

target 'MASStarter' do
 use_frameworks!
 pod 'DGActivityIndicatorView'
 pod 'SABlurImageViewObjc'
 pod 'SCLAlertView-Objective-C'
 pod 'MASFoundation'
end

you will get:

#import <MASFoundation/MAS.h> 'MASFoundation/MAS.h' file not found

screen shot 2017-01-06 at 2 53 22 pm

Login issues with the SDK

We keep experiencing issues with the login api from the SDK
following is snippet of the same
Error Domain=com.ca.MASFoundation:ErrorDomain Code=3003107 "The registered device record is invalid" UserInfo={status-code=400, MASResponseInfoBodyInfoKey={
error = "invalid_request";
"error_description" = "The given mag-identifier is either invalid or points to an unknown device";
}

can you please help us with some info regarding this

How to send JSON Array in request body?

Hello,
I have to send a json array inside the request body.

It seems the MASRequest body attribute only accepts a dictionary.

How can I accomplish that?

I was able to do that effortless on Android SDK.

Thanks

Unable to login using MASUser from MASFoundation.

MASFoundation 1.9.00

What is happening
I am trying to login a user using the MAS SDK.

I am using the function loginWithUserName from the MASUser.

When I try to login, my app crashes and I get the following debug output:

*** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[_NSZeroData subdataWithRange:]: range {1, 18446744073709551615} causes integer overflow'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23b98bde __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff503b5b20 objc_exception_throw + 48
2 Foundation 0x00007fff255ddb3c -[NSData(NSData) writeToFile:options:error:] + 0
3 MASFoundation 0x000000010e7a1557 -[MASASN1Decoder parseWithRange:] + 2359
4 MASFoundation 0x000000010e7a0be8 -[MASASN1Decoder decodeASN1] + 216
5 MASFoundation 0x000000010e6e7d61 -[MASDERCertificate parseCertificateData] + 257
6 MASFoundation 0x000000010e7a57ce -[MASDevice(MASPrivate) saveWithUpdatedInfo:] + 1470
7 MASFoundation 0x000000010e748152 __63-[MASAuthCredentials(MASPrivate) registerDeviceWithCredential:]_block_invoke + 1474
8 MASFoundation 0x000000010e730679 __147-[MASNetworkingService sessionDataTaskCompletionBlockWithEndPoint:parameters:headers:httpMethod:requestType:responseType:isPublic:completionBlock:]_block_invoke + 8633
9 MASFoundation 0x000000010e7b057f __67-[MASURLSessionManager dataOperationWithRequest:completionHandler:]_block_invoke + 255
10 MASFoundation 0x000000010e77f1e8 __68-[MASSessionDataTaskOperation URLSession:task:didCompleteWithError:]_block_invoke.419 + 104
11 libdispatch.dylib 0x000000010e9a7df0 _dispatch_call_block_and_release + 12
12 libdispatch.dylib 0x000000010e9a8d64 _dispatch_client_callout + 8
13 libdispatch.dylib 0x000000010e9b6b11 _dispatch_main_queue_callback_4CF + 721
14 CoreFoundation 0x00007fff23afb699 CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 9
15 CoreFoundation 0x00007fff23af62f9 __CFRunLoopRun + 2329
16 CoreFoundation 0x00007fff23af56b6 CFRunLoopRunSpecific + 438
17 GraphicsServices 0x00007fff3815cbb0 GSEventRunModal + 65
18 UIKitCore 0x00007fff47162a67 UIApplicationMain + 1621
19 rnt 0x000000010d569d10 main + 112
20 libdyld.dylib 0x00007fff5123bcf5 start + 1
21 ??? 0x0000000000000001 0x0 + 1

What should happen
The sdk should login correctly and return a MASUser object.

Does anyone know how to fix this?_

Question: Set global requests connect and read timouts

Greetings,

In Android MAS SDK It's possible to set requests connect and read timeouts globally, using something like this:

MAS.setConnectionListener(new MASConnectionListener() {


@Override


public void onObtained(HttpURLConnection connection) {


connection.setConnectTimeout(2000);


connection.setReadTimeout(2000);


}


}

Using this code, implicit requests (like initialize, register, login...) also use this timeout values. Is it possible to achieve the same behavior in iOS MAS SDK?

Test

Testing email notifications.

Error - TLS version below 1.2

Hi,

I'm getting the error message: An SSL error has occurred, this may be caused by attempting to connect to a server using TLS version below 1.2.

How can I force the use of the TLS 1.2 version?

Unable to export archive

Hi all,
recently I have got the following error:

"UserInfo={NSLocalizedDescription=Failed to verify bitcode in MASFoundation.framework/MASFoundation:
error: Linker option verification failed for bundle /var/folders/63/1jskwlm14l1939nl96hy4zqw0000gn/T/MASFoundationhvZjDr/MASFoundation.armv7.xar (unrecognized arguments: -platform_version iOS 9.0.0 13.0.0)}

Please can you help me?

Renwal Client Certificate

Hi Support Team,

I have been using MAG SDK for my iOS application, It seems there is bug in SDK. Renwal process uses "PUT" method and request and response type is JSON, however type being received for client certificate is text/plain in renewal process.

I have tried to change response type to text/plain, i was able to receive certificate but it somehow stop other operation to work.

So we have one api that throws error code 206, which eventually trigger renewal process which causes above mentioned error.

please help me to resolve this issue.

MASRequestBuilder only accept dictionary as body

PR: #291

Currently the MASRequest builder only accepts an NSDictionary as the request body. This is an issue as not all (of our) endpoints expect a dictionary as the root object of a request's body.

Some possible fixes could be to:

  1. use id as the body's type (this change does not existing impact users when they update).
  2. use NSData as the body's type (breaking change and users have to encode the json themselves. Offers flexibility however).
  3. Introduce a JSONObject class as the body's type (JSONObject would then be initializable with all valid json data types: NSNumber, NSString, Bool, NSDictionary, NSArray, etc. This limits the amount of "valid" types a user could use to set the request body):
@interface MASJsonObject: NSObject

@property (nonatomic, strong) id value;

- (instancetype)init NS_UNAVAILABLE;

- (instancetype)initWithString:(NSString *)string;
- (instancetype)initWithBool:(BOOL)boolean;
- (instancetype)initWithNumber:(NSNumber *)number;
- (instancetype)initWithDictionary:(NSDictionary *)dictionary;
- (instancetype)initWithArray:(NSArray *)array;

@end


@implementation MASJsonObject

- (instancetype)initWithString:(NSString *)string {
   self = [super init];
   if (self)
   {
       self.value = string;
   }
   return self;
}

// etc...

@end

Cocoapod for 1.6.10

Could you please add pods for version 1.6.10 for:

MASUI
MASConnecta
MASIdentityManagement
MASStorage
MASFoundation

Support for multiPartFormData

Hi,

I could find (on MAS for android) a way to send multipart/formdata creating the request using MASRequest and the body using MASRequestBody. But could find that classes on iOS.

It would be great if the lib could support multipart/formdata iOS.

Setting prefix in msso_config causes all API calls to require the prefix in their path.

Example:
=== msso_config.json snippet ==
"server": {
"hostname": "api.yourhost.com",
"port": 8443,
"prefix": "ext",

"server_certs": ....

While this works when doing standard login flows, etc. the default behavior of a MAS.getFrom or .postTo, etc causes any API call (ex. MAS.getFrom("/api"...) to require the API to actually be located at "/ext/api".

The default behavior should be to defer to the absolute path being passed.

MASUser.login - iOS 13 b1 error

Good Morning,

I'm having a device runing iOS 13 beta 1 to test compability, but the MASUser.login doesn't work, but on the current iOS 12.3, it works just fine.
I know that the beta was released yesterday, just want to warning about the problem.

MASUser.login(with: credentials, completion: { (completed, error) in
    if (!completed) {
        if (error != nil) {
            onError()
        }
    } else {
        if (error == nil) {
            onSuccess()
        }
    }
})

The completed is returning false, and the error is returning the following:

Error Domain=com.ca.MASFoundation.localError:ErrorDomain Code=-999 "SSL pinning validation failed: ensure the target domain’s MASSecurityConfiguration is correctly configured." UserInfo={NSLocalizedDescription=SSL pinning validation failed: ensure the target domain’s MASSecurityConfiguration is correctly configured., status-code=0}

Renewal Client Certificate Issue

Hi Support Team,

I have been using MAG SDK for my iOS application, It seems there is bug in SDK. Renwal process uses PUT method and request and response type is JSON, however type being received for client certificate is text/plain in renewal process.

I have tried to change response type to text/plain, i was able to receive certificate but it somehow stop other operation to work.

So we have one api that throws error code 206, which eventually trigger renewal process which causes above mentioned error.

please help me to resolve this issue.

Special Character "&" issue still persistes

Hi, I had opened an issue related to the truncation of password or username if the special character '&' is passed in password through your SDK, the link is as below
#126

I understand you made a fix by using the native iOS encoding using stringByAddingPercentEncodingWithAllowedCharacters for character set "!*'();:@&=+$,/?%#[] " in your function
escapeValueForURLParameter however this has not helped resolve the issue and I believe the issue is at another place as I have been going through your code and I realized the method

[[MASNetworkingService sharedService] postTo:registerEndpoint
withParameters:parameterInfo
andHeaders:headerInfo
requestType:MASRequestResponseTypeTextPlain
responseType:MASRequestResponseTypeTextPlain
completion:^(NSDictionary<NSString *,id> * _Nullable responseInfo, NSError * _Nullable error) {}];
Throws an error of 401 unauthorized, when trying to call data

  • (void)registerDeviceWithCredential:(MASCompletionErrorBlock)completion

and hence never reaches the method escapeValueForURLParameter where you have made the fix for the previous opened issue, can you please Help us out as to why it returns unautorized at this point.

Conflict on function appendUTF8String on NSMutableData extension

In my company, we have a project that uses MASFoundation combined with some analytics libraries. One of these libraries, Dynatrace, have a conflict in the mentioned function. This conflict cause an invalidation on the CSR generation, because the implementation on the Dynatrace's library don't append the bytes for type and size of the contents and the obtained result have two bites less than necessary. My suggestion is change the declaration of the function to avoid this conflicts.

Bitcode error in jenkins build due to MasFoundation

Hi,
We are using 1.9.10 version of your library MASFoundation, and we keep encountering this error

Failed to verify bitcode in MASFoundation.framework/MASFoundation:
error: Linker option verification failed for bundle /var/folders/63/1jskwlm14l1939nl96hy4zqw0000gn/T/MASFoundationopqylu/MASFoundation.armv7.xar (unrecognized arguments: -platform_version iOS 9.0.0 13.0.0)

Upgrading to 1.9.20, did not help, the started occurring after the release of iOS 13

Can you please let us know what could be the possible reason for it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.