Skip to content

Commit

Permalink
Merge pull request #419 from atsign-foundation/at_commons/deprecate_a…
Browse files Browse the repository at this point in the history
…t_constants

chore(at_commons): wrap all vars in at_constants.dart
  • Loading branch information
XavierChanth authored Oct 3, 2023
2 parents 6b8e30d + 66eaba7 commit d7a8ed7
Show file tree
Hide file tree
Showing 3 changed files with 435 additions and 108 deletions.
3 changes: 2 additions & 1 deletion packages/at_commons/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
## 3.0.56
- feat: Introduce "AtInvalidEnrollmentException" which is thrown when an enrollment is expired or invalid
- feat: Introduce error code 'AT0030' for Invalid Enrollment Status
- chore: Deprecated all variables in `src/at_constants.dart`, use `AtConstants.<variable-name>` instead
## 3.0.55
- feat: Introduce "AtThrottleLimitExceeded" exception which is thrown when enrollment request exceeds the limit
- feat: Introduce new error codes for apkam enrollments
- feat: Introduce new error codes for apkam enrollments
## 3.0.54
- fix: Modify "totp" verb regex to include alpha-numeric characters
- feat: Introduce "EnrollResponse" class which represents the enrollment response.
Expand Down
220 changes: 113 additions & 107 deletions packages/at_commons/lib/src/at_constants.dart
Original file line number Diff line number Diff line change
@@ -1,107 +1,113 @@
// ignore_for_file: constant_identifier_names
const String AT_SIGN = 'atSign';
const String FOR_AT_SIGN = 'forAtSign';
const String AT_KEY = 'atKey';
const String AT_VALUE = 'value';
const String AT_DIGEST = 'digest';
const String AT_PKAM_SIGNATURE = 'signature';
const String AT_PKAM_SIGNING_ALGO = 'signingAlgo';
const String AT_PKAM_HASHING_ALGO = 'hashingAlgo';
const String PUBLIC_SCOPE_PARAM = 'publicScope';
const String AT_PKAM_PRIVATE_KEY = 'privatekey:at_pkam_privatekey';
const String AT_PKAM_PUBLIC_KEY = 'privatekey:at_pkam_publickey';
const String AT_ENCRYPTION_PUBLIC_KEY = 'public:publickey';
const String AT_ENCRYPTION_PRIVATE_KEY = 'privatekey:privatekey';
const String AT_ENCRYPTION_SHARED_KEY = 'shared_key';
const String AT_ENCRYPTION_SELF_KEY = 'privatekey:self_encryption_key';
const String AT_SIGNING_PRIVATE_KEY = 'signing_privatekey';
const String AT_SIGNING_PUBLIC_KEY = 'public:signing_publickey';
const String AT_CRAM_SECRET = 'privatekey:at_secret';
const String AT_CRAM_SECRET_DELETED = 'privatekey:at_secret_deleted';
const String AT_SIGNING_KEYPAIR_GENERATED =
'privatekey:signing_keypair_generated';
const String AT_STAT_ID = 'statId';
const String AT_TTL = 'ttl';
const String AT_TTB = 'ttb';
const String AT_TTR = 'ttr';
const String AT_TTL_NOTIFICATION = 'ttln';
const String AT_FROM_COMMIT_SEQUENCE = 'from_commit_seq';
const String AT_OPERATION = 'operation';
const String AT_VALUE_REFERENCE = 'atsign://';
const String AT_REGEX = 'regex';
const String CONFIG_NEW = 'configNew';
const String FROM_AT_SIGN = 'fromAtSign';
const String TO_AT_SIGN = 'toAtSign';
const String NOTIFICATION = 'notification';
const String FROM = 'from';
const String TO = 'to';
const String KEY = 'key';
const String EPOCH_MILLIS = 'epochMillis';
const String MONITOR_STRICT_MODE = 'strict';
const String MONITOR_MULTIPLEXED_MODE = 'multiplexed';
const String MONITOR_REGEX = 'regex';
const String MONITOR_SELF_NOTIFICATIONS = 'selfNotifications';
const String ID = 'id';
const String OPERATION = 'operation';
const String SET_OPERATION = 'setOperation';
const String UPDATE_META = 'meta';
const String UPDATE_JSON = 'update:json';
const String VALUE = 'value';
const String UPDATE_ALL = 'all';
const String CCD = 'ccd';
const String CACHED = 'cached';
const String REFRESH_AT = 'refreshAt';
const String IS_BINARY = 'isBinary';
const String IS_ENCRYPTED = 'isEncrypted';
const String IS_PUBLIC = 'isPublic';
const String ENCRYPTING_KEY_NAME = 'encKeyName';
const String ENCRYPTING_ALGO = 'encAlgo';
const String IV_OR_NONCE = 'ivNonce';
const String PUBLIC_DATA_SIGNATURE = 'dataSignature';
const String SHARED_KEY_STATUS = 'sharedKeyStatus';
const String SHARED_KEY_ENCRYPTED = 'sharedKeyEnc';
const String SHARED_WITH_PUBLIC_KEY_CHECK_SUM = 'pubKeyCS';
const String SHARED_KEY_ENCRYPTED_ENCRYPTING_KEY_NAME = 'skeEncKeyName';
const String SHARED_KEY_ENCRYPTED_ENCRYPTING_ALGO = 'skeEncAlgo';
const String FIRST_BYTE = '#';
const String CREATED_AT = 'createdAt';
const String UPDATED_AT = 'updatedAt';
const String PRIORITY = 'priority';
const String STRATEGY = 'strategy';
const String NOTIFIER = 'notifier';
const String LATEST_N = 'latestN';
const String SYSTEM = 'SYSTEM';
const String MESSAGE_TYPE = 'messageType';
const String PAGE = 'page';
const String commitLogCompactionKey = 'privatekey:commitLogCompactionStats';
const String accessLogCompactionKey = 'privatekey:accessLogCompactionStats';
const String notificationCompactionKey =
'privatekey:notificationCompactionStats';
const String bypassCache = 'bypassCache';
const String showHidden = 'showhidden';
const String statsNotificationId = '_latestNotificationIdv2';
const String ENCODING = 'encoding';
const String CLIENT_CONFIG = 'clientConfig';
const String VERSION = 'version';
const String IS_LOCAL = 'isLocal';
const String CLIENT_ID = 'clientId';
const String APP_NAME = 'appName';
const String APP_VERSION = 'appVersion';
const String PLATFORM = 'platform';
const String enrollmentId = 'enrollmentId';
const String keyType = 'keyType';
const String keyValue = 'keyValue';
const String visibility = 'visibility';
const String namespace = 'namespace';
const String keyName = 'keyName';
const String deviceName = 'deviceName';
const String encryptionKeyName = 'encryptionKeyName';
const String apkamEncryptedDefaultPrivateKey = 'encryptedDefaultEncPrivateKey';
const String apkamEncryptedDefaultSelfEncryptionKey =
'encryptedDefaultSelfEncryptionKey';
const String apkamEncryptedSymmetricKey = 'encryptedApkamSymmetricKey';
const String apkamPublicKey = 'apkamPublicKey';
const String apkamNamespaces = 'namespaces';
const String defaultEncryptionPrivateKey = 'default_enc_private_key';
const String defaultSelfEncryptionKey = 'default_self_enc_key';
const String enrollParams = 'enrollParams';
part 'at_constants_legacy.dart';

class AtConstants {
static const String atSign = 'atSign';
static const String forAtSign = 'forAtSign';
static const String atKey = 'atKey';
static const String atValue = 'value';
static const String atDigest = 'digest';
static const String atPkamSignature = 'signature';
static const String atPkamSigningAlgo = 'signingAlgo';
static const String atPkamHashingAlgo = 'hashingAlgo';
static const String publicScopeParam = 'publicScope';
static const String atPkamPrivateKey = 'privatekey:at_pkam_privatekey';
static const String atPkamPublicKey = 'privatekey:at_pkam_publickey';
static const String atEncryptionPublicKey = 'public:publickey';
static const String atEncryptionPrivateKey = 'privatekey:privatekey';
static const String atEncryptionSharedKey = 'shared_key';
static const String atEncryptionSelfKey = 'privatekey:self_encryption_key';
static const String atSigningPrivateKey = 'signing_privatekey';
static const String atSigningPublicKey = 'public:signing_publickey';
static const String atCramSecret = 'privatekey:at_secret';
static const String atCramSecretDeleted = 'privatekey:at_secret_deleted';
static const String atSigningKeypairGenerated =
'privatekey:signing_keypair_generated';
static const String statId = 'statId';
static const String ttl = 'ttl';
static const String ttb = 'ttb';
static const String ttr = 'ttr';
static const String ttlNotification = 'ttln';
static const String fromCommitSequence = 'from_commit_seq';
static const String atOperation = 'operation';
static const String atValueReference = 'atsign://';
static const String regex = 'regex';
static const String configNew = 'configNew';
static const String fromAtSign = 'fromAtSign';
static const String toAtSign = 'toAtSign';
static const String notification = 'notification';
static const String from = 'from';
static const String to = 'to';
static const String key = 'key';
static const String epochMilliseconds = 'epochMillis';
static const String monitorStrictMode = 'strict';
static const String monitorMultiplexedMode = 'multiplexed';
static const String monitorRegex = 'regex';
static const String monitorSelfNotifications = 'selfNotifications';
static const String id = 'id';
static const String operation = 'operation';
static const String setOperation = 'setOperation';
static const String updateMeta = 'meta';
static const String updateJson = 'update:json';
static const String value = 'value';
static const String updateAll = 'all';
static const String ccd = 'ccd';
static const String cached = 'cached';
static const String refreshAt = 'refreshAt';
static const String isBinary = 'isBinary';
static const String isEncrypted = 'isEncrypted';
static const String isPublic = 'isPublic';
static const String encryptingKeyName = 'encKeyName';
static const String encryptingAlgo = 'encAlgo';
static const String ivOrNonce = 'ivNonce';
static const String publicDataSignature = 'dataSignature';
static const String sharedKeyStatus = 'sharedKeyStatus';
static const String sharedKeyEncrypted = 'sharedKeyEnc';
static const String sharedWithPublicKeyCheckSum = 'pubKeyCS';
static const String sharedKeyEncryptedEncryptingKeyName = 'skeEncKeyName';
static const String sharedKeyEncryptedEncryptingAlgo = 'skeEncAlgo';
static const String firstByte = '#';
static const String createdAt = 'createdAt';
static const String updatedAt = 'updatedAt';
static const String priority = 'priority';
static const String strategy = 'strategy';
static const String notifier = 'notifier';
static const String latestN = 'latestN';
static const String system = 'SYSTEM';
static const String messageType = 'messageType';
static const String page = 'page';
static const String commitLogCompactionKey =
'privatekey:commitLogCompactionStats';
static const String accessLogCompactionKey =
'privatekey:accessLogCompactionStats';
static const String notificationCompactionKey =
'privatekey:notificationCompactionStats';
static const String bypassCache = 'bypassCache';
static const String showHidden = 'showhidden';
static const String statsNotificationId = '_latestNotificationIdv2';
static const String encoding = 'encoding';
static const String clientConfig = 'clientConfig';
static const String version = 'version';
static const String isLocal = 'isLocal';
static const String clientId = 'clientId';
static const String appName = 'appName';
static const String appVersion = 'appVersion';
static const String platform = 'platform';
static const String enrollmentId = 'enrollmentId';
static const String keyType = 'keyType';
static const String keyValue = 'keyValue';
static const String visibility = 'visibility';
static const String namespace = 'namespace';
static const String keyName = 'keyName';
static const String deviceName = 'deviceName';
static const String encryptionKeyName = 'encryptionKeyName';
static const String apkamEncryptedDefaultPrivateKey =
'encryptedDefaultEncPrivateKey';
static const String apkamEncryptedDefaultSelfEncryptionKey =
'encryptedDefaultSelfEncryptionKey';
static const String apkamEncryptedSymmetricKey = 'encryptedApkamSymmetricKey';
static const String apkamPublicKey = 'apkamPublicKey';
static const String apkamNamespaces = 'namespaces';
static const String defaultEncryptionPrivateKey = 'default_enc_private_key';
static const String defaultSelfEncryptionKey = 'default_self_enc_key';
static const String enrollParams = 'enrollParams';
}
Loading

0 comments on commit d7a8ed7

Please sign in to comment.