mirror of
https://github.com/MacPass/MacPass.git
synced 2025-12-13 08:52:20 +00:00
documented Autotype context API to make internal behaviour clear
This commit is contained in:
@@ -41,11 +41,16 @@
|
||||
@property (nonatomic, readonly, copy) NSString *command;
|
||||
@property (nonatomic, readonly, copy) NSString *normalizedCommand;
|
||||
/**
|
||||
* Command with placeholders and references resolved
|
||||
* Command with placeholders and references resolved.
|
||||
* This will evaluate any placeholder regardless of side-effects.
|
||||
* If you need to evaluat the command without interaction, you should call kpk_finalValueForEntry:options: directly on the normalizedCommand.
|
||||
*/
|
||||
@property (nonatomic, readonly, copy) NSString *evaluatedCommand;
|
||||
/**
|
||||
@return command with placeholders and references resolved but masked password placeholder
|
||||
@return command with placeholders and references resolved but masked password placeholder.
|
||||
|
||||
This will call kpk_finalValueForEntry:options on the normalizedCommand with options set to KPKCommandEvaluationOptionSkipUserInteraction and KPKCommandEvaluationOptionReadOnly.
|
||||
This way it is ensured that the value can be used in UI without any intereference or data changes!
|
||||
*/
|
||||
@property (nonatomic, readonly, copy) NSString *maskedEvaluatedCommand;
|
||||
/**
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
NSString *passwordPlaceholder = [NSString stringWithFormat:@"{%@}",kKPKPasswordKey];
|
||||
NSString *normalized = self.normalizedCommand;
|
||||
NSString *masked = [normalized stringByReplacingOccurrencesOfString:passwordPlaceholder withString:@"•••" options:NSCaseInsensitiveSearch range:NSMakeRange(0, normalized.length)];
|
||||
return [[masked kpk_finalValueForEntry:self.entry] copy];
|
||||
return [[masked kpk_finalValueForEntry:self.entry options:KPKCommandEvaluationOptionSkipUserInteraction|KPKCommandEvaluationOptionReadOnly] copy];
|
||||
}
|
||||
|
||||
- (NSString *)description {
|
||||
|
||||
Reference in New Issue
Block a user