Noutați

RAD Server and the included Data Storage for RAD Server Users

Embarcadero’s RAD Server Enterprise Mobility Server (EMS) is a turn-key application foundation for rapidly building and deploying services based applications. RAD Server’s core offerings include automated Delphi and C++ REST/JSON API publishing and management, Enterprise database integration middleware, IoT Edgeware and an array of application services such as User Directory and Authentication services, Push Notifications, Indoor/Outdoor Geolocation and JSON data storage. RAD Server enables developers to quickly build new application back-ends or migrate existing Delphi or C++ client/server business logic to a modern services based architecture that is open, stateless, secure and scalable. RAD Server is easy to develop, deploy and operate making it ideally suited for ISVs and OEMs building re-deployable solutions. Two important and useful features included with RAD Server are: 1. It’s important to note that a RAD Server single site license (included in Enterprise Edition) still allows you to deploy a solution based on multiple instances of the RAD Server engine, on multiple physical or virtual servers, for fail-over and load balancing, as long as they are backed by a single instance of the RAD Server database (the included InterBase database instance) which manages the RAD Server license itself. 2. It’s also important to note that Data Storage for Users in the form of JSON name/value pairs is part of the core RAD Server offering. But the use of the included RAD Server InterBase database as a relational DB is subject to a separate license (and also the installation of a separate InterBase server instance). This post focuses on how to use RAD Server to add JSON data storage, to create some Custom Fields to store additional JSON name-value information for your RAD Server Users. The included RAD Server InterBase database creates a USERS table. The RAD Server USERS Table allows you to manage the RAD Server Users data that are stored in your RAD Server Engine (EMS Server). The USERS Table stores information about RAD Server Users in the RAD Server Engine (EMS Server): The RAD Server USERS table columns are listed here: /* Table: USERS, Owner: SYSDBA */ CREATE TABLE USERS ( UID INTEGER NOT NULL, TID INTEGER NOT NULL, USERID CHAR(36) NOT NULL, USERNAME VARCHAR(32) NOT NULL, HPASSWORD CHAR(32), SALT CHAR(6), SESSIONID CHAR(32), SESSIONTIME TIMESTAMP, ISACTIVE BOOLEAN DEFAULT TRUE, CREATED TIMESTAMP, LASTMODIFIED TIMESTAMP, CREATOR CHAR(36), UNIQUE (USERID), PRIMARY KEY (UID), CONSTRAINT USERS_UNIQ UNIQUE (USERNAME, TID) ); ALTER TABLE USERS ADD CONSTRAINT TUSERS FOREIGN KEY (TID) REFERENCES TENANTS (TID); /* Meta data descriptions. This syntax requires InterBase 2020 or higher. Some tables require ODS18 and higher */ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 /* Table: USERS, Owner: SYSDBA */ CREATE TABLE USERS (         UID INTEGER NOT NULL,         TID INTEGER NOT NULL,         USERID CHAR(36) NOT NULL,         USERNAME VARCHAR(32) NOT NULL,         HPASSWORD CHAR(32),         SALT CHAR(6),         SESSIONID CHAR(32),         SESSIONTIME TIMESTAMP,         ISACTIVE BOOLEAN DEFAULT TRUE,         CREATED TIMESTAMP,         LASTMODIFIED TIMESTAMP,         CREATOR CHAR(36), UNIQUE (USERID), PRIMARY KEY (UID), CONSTRAINT USERS_UNIQ UNIQUE (USERNAME, TID) ); ALTER TABLE USERS ADD CONSTRAINT TUSERS FOREIGN KEY (TID) REFERENCES TENANTS (TID); /* Meta data descriptions.   This syntax requires InterBase 2020 or higher.   Some tables require ODS18 and higher */ The UID is the USERID is a Unique identifier of a RAD Server User (UserID) in the RAD Server […]

Read More

We welcome Abatic, consulting partner for Spanish TMS/Delphi users

We are proud to announce a new collaboration with the team from Abatic in Spain to assist users of Delphi in combination with TMS products. From today, Abatic is our consulting partner for Spanish speaking software developers and software development companies in Spain and Colombia. With our partners we aim to have experts nearby, in the same timezone and speaking the native language of our customers to help with consulting services. This can range from assisting with: designing software architectures choosing the best components for a task developing projects or parts of projects or adding resources to help with developing projects offering training in specific TMS products We are glad to start this partnership with Abatic as we are convinced their high expertise will offer excellent services for you. The team consists of 6 professionals including two Embarcadero MVP’s: Emilio Pérez and Jhonny Suárez. Emilio Pérez Jhonny Suárez Abatic is also an early adaptor of TMS WEB Core and in particular TMS WEB Core for Visual Studio Code and is even offering a training course and an ebook for it: Among the broad expertise of the Abatic team are: Delphi Developer Certified 2 Embarcadero MVP consultants in team WEB Core web applications VCL Windows applications FMX cross-platform applications Multi-tier database development XData REST server + Aurelius ORM On-site training / WEB Core training course MySQL developer Certified PostgreSQL DBA Certified RAD Server We are convinced this will strengthen the adoption of Delphi, of our components and will lead to better, richer and more sophisticated Delphi applications with TMS compoonents or web applications based on the TMS WEB Core framework. With the Abatic team closely in touch with Spanish speaking developers, our team will have the opportunity to closely listen to the feedback and wishes of the Spanish speaking community and steer our developments according to these needs. If you are not Spanish speaking, don’t worry, our consulting partner network is growing and feel free to have a look at the partner directory and get in touch and have a chat how they can help you. At the same time, we would like to take the opportunity to mention that we still wish to extend our consulting partner network, foremost in the Asia area, Australia, Canada, South Africa. If you are Delphi developer with TMS component expertise and offering consulting services, get in touch and we will be happy to discuss how we can move forward!

Read More

TMS FNC Maps: Small update with big improvements

Intro With the release of TMS WEB Core v1.6 beta yesterday (https://tmssoftware.com/site/blog.asp?post=717), we bring a whole set of new and exciting compiler features such as generics, attributes and many more. Please read the blog and start exploring the new features. The beta of TMS WEB Core v1.6 is available as a download on the My Products page. Today, we released all of our FNC products with some core improvements, ready to be used in combination with TMS WEB Core v1.6. On top of that, TMS FNC Maps has been released with 3 new features. Tile Layers TTMSFNCOpenLayers now supports adding tile layers in the XYZ format. To demonstrate this, we generated a free API key from the following service: https://www.thunderforest.com. This service offers a great set of high quality layers that can be used in combination with our TTMSFNCOpenLayers implementation. To add a layer we used the following code: procedure TForm1.AddLayer; begin TMSFNCOpenLayers1.AddTileLayer(‘https://{a-c}.tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=[INSERT API KEY]’); end; With the following result: Save coordinate data to GPX The update also brings a way to save your coordinate data to a GPX file. To implement this, use one of the following overloads procedure SaveToGPXStream(ACoordinates: TTMSFNCMapsCoordinateRecArray; AStream: TStream); procedure SaveToGPXStream(ACoordinates: TTMSFNCMapsCoordinateRecArray; AStream: TStream; AMetaData: TTMSFNCMapsGPXMetaData); procedure SaveToGPXFile(ACoordinates: TTMSFNCMapsCoordinateRecArray; AFileName: string); procedure SaveToGPXFile(ACoordinates: TTMSFNCMapsCoordinateRecArray; AFileName: string; AMetaData: TTMSFNCMapsGPXMetaData); function SaveToGPXText(ACoordinates: TTMSFNCMapsCoordinateRecArray): string; function SaveToGPXText(ACoordinates: TTMSFNCMapsCoordinateRecArray; AMetaData: TTMSFNCMapsGPXMetaData): string;; The TTMSFNCMapsGPXMetaData record currently allows specifying the following GPX attributes AuthorName AuthorLink TrackName TrackType Plus Codes Plus Codes are like street addresses for people or places that don’t have one. Instead of addresses with street names and numbers, Plus Codes are based on latitude and longitude, and displayed as numbers and letters. With a Plus Code, people can receive deliveries, access emergency and social services, or just help other people find them. source: https://maps.google.com/pluscodes/ TMS FNC Maps supports Plus Codes encoding & decoding with the TTMSFNCMapsPlusCode class (available in the *.TMSFNCMapsCommonTypes unit). To get started, and convert an existing coordinate to a Plus Code, use the following code: procedure TForm1.EncodeCoordinate; var p: string; begin p := TTMSFNCMapsPlusCode.Encode(CreateCoordinate(40.689188, -74.044562)); //p = ’87G7MXQ4+M5′ end; To decode a Plus Code to a coordinate bounds, which defines the area corresponding to the code, the Decode function can be used: procedure TForm1.DecodePlusCode; var c: TTMSFNCMapsBoundsRec; begin c := TTMSFNCMapsPlusCode.Decode(’87G7MXQ4+M5′); end; Update Now! Update now to get all the latest and greatest FNC updates and get started exploring the new features of TMS WEB Core 1.6!

Read More

C Header Translator Tool For Delphi Lets You Parse C Header Files Using The Clang Compiler

Since Chet uses an actual compiler, you will need to have a (minimal) C develop environment installed, as well as LLVM with Clang. Clang needs to be able to find the system headers for the development environment. These will usually be available if you have some version of Visual Studio with Visual C++ installed. The free (community) edition of Visual Studio suffices. As said in the readme on Github, unlike some other header translators, Chet uses the Clang compiler to parse header files, resulting in more accurate translations that require fewer manual adjustments. Please check out the awesome features Chet lists: Translates C data types such as structs, union, enums, typedefs, procedural types and opaque types. Translates C functions to Delphi procedures or functions. Tries to translate #define declarations to constants where possible. Generates a single .pas file for an entire directory of .h files. This reduces issues due to dependencies between header files. Generates output for multiple platforms (Windows, macOS, Linux, iOS and Android) if desired. You can customize the Clang parsing process by supplying command line arguments to the compiler. You can customize the output of some conversion operations. Retains any Doxygen style documentation comments if desired, or converts them to XmlDoc comments or PasDoc comments. Provides a GUI for configuring the conversion process, and allows you to save the conversion settings to a .chet project file for reuse. Although Chet has amazing features, there are some limitations that the user has to pay attention on: Chet only works with C header files, not with C++ header files. All non-inlined functions in the header files are translated and assumed to be available in the static or dynamic library for the project. This does not have to be the case. (Inlined functions are never translated since they are never available in the library.) Since Clang is used to parse the header files, this means that Clangs preprocessor is run as well to perform conditional parsing (guided by #ifdef directives). This is both good and bad. It is good because it improves conversion accuracy. But it can be bad because it uses the system that Chet runs on to determine some conditional paths. For example, because Chet runs on Windows, it will parse code in #ifdef _WIN32 sections but skip any code in sections for other platforms. You can run Chet first to check for any errors related to missing dependencies. If you get any dependency errors when running the translator, then you can download the dependencies here: LLVM with Clang (Clang for Windows (64-bit) is recommended); Visual Studio IDE (the free Community edition suffices; be sure to install C++ support). You can use the pre-compiled 64-bit Windows Chet application in the Bin directory. If you want to compile Chet yourself, then you also need libclang for Delphi and make sure the Delphi IDE can find it (the Chet project will find it automatically if the Neslib.Clang directory is at the same level as the Chet directory). Chet is licensed under the Simplified BSD License. From the Github article we understand that Chet is pretty straightforward. In many cases, you only need to provide a directory with header files, the name of the output .pas file and select “Run Header Translator (F9)”. For more control over the conversion process, you can specify various options, described below. The screenshot from GitHub for the project is below: This […]

Read More

Powerful LockBox3 Cryptography Library Available For Delphi And C++Builder

LockBox3 is a Delphi library for cryptography. It provides support for AES, DES, 3DES, Blowfish, Twofish, SHA, MD5, a variety of chaining modes, RSA digital signature and verification. This is a source-only release of TurboPack LockBox3. It includes designtime and runtime packages for Delphi and C++Builder and supports VCL, FMX, Win32, Win64, macOS, iOS, and Android. Reading the information from http://lockbox.seanbdurkin.id.au/HomePage, “the user interface shall be clean and simple. For Ciphers and Hashes, two styles shall be provided: A component and an interface pointer. IV, salting of ciphers and signaling of IV’s shall be managed and hidden from the developer-client. The main encryption functions shall be implemented in 100% native Delphi code. (TOpenSSL_Signatory component is the exception to the rule).“ That is to say it shall not rely on links to third party libraries (at least as far as the core functionality is concerned). LockBox 3 is has easy traceability to standards. Developers should be able to open cipher standards and open the respective implementing source code; put them side-by-side, and very quickly observer that one implements the other. implementing source should borrow the style and symbols and the specifiying cipher standard.It shall be as easy as it can be to extend the library with new hashes and block ciphers. The selection, implementation and usage of ciphers shall be divorced from the chaining mode. LockBox3CR.bpl (C++Builder Runtime) and LockBox3CD.bpl (C++Builder Designtime). TurboPack LockBox3 is available via the GetIt Package Manager where you can quickly and easily install and uninstall it. To manually install TurboPack LockBox3 into your IDE, take the following steps: Unzip the release files into a directory (e.g., d:lockBox3); Start RAD Studio; Add the source directory (e.g. d:lockBox3run and all the subdirectories) to the IDE’s library path. For C++Builder, add the hpp subdirectory (e.g., d:lockBox3sourcehppWin32Release) to the IDE’s system include path; Open & install the designtime package specific to the IDE being used. The IDE should notify you the components have been installed; I can tell for sure that this is the best choice for cryptography library ! If you want to download this package via GitHub, please refer to the link below: https://github.com/TurboPack/LockBox3 Or find out more about TurboPack LockBox3 and download it via Embarcadero GetIt.

Read More

Learn How To Use C++ Defaulted Functions For Windows Development With C++ Builder

A defaulted function is a function that contains =default; in its prototype. This construction indicates that the function’s default definition should be used. Defaulted functions are a C++11 specific feature. Defaulted functions example class A { A() = default; // OK A& operator = (A & a) = default; // OK void f() = default; // ill-formed, only special member function may be defaulted }; class A {         A() = default;                    // OK         A& operator = (A & a) = default;  // OK         void f() = default;               // ill-formed, only special member function may be defaulted }; By default, C++ provides four default special member functions. Users may override these defaults. destructor default constructor copy constructor copy assignment operator = Also by default, C++ applies several global operators to classes. Users may provide class-specific operators. sequence operator , address-of operator & indirection operator * member access operator -> member indirection operator ->* free-store allocation operator new free-store deallocation operator delete The management of defaults has several problems: Constructor definitions are coupled; declaring any constructor suppresses the default constructor. The destructor default is inappropriate to polymorphic classes, requiring an explicit definition. Once a default is suppressed, there is no means to resurrect it. Default implementations are often more efficient than manually specified implementations. Non-default implementations are non-trivial, which affects type semantics, e.g. makes a type non-POD. There is no means to prohibit a special member function or global operator without declaring a (non-trivial) substitute. The most common encounter with these problems is when disabling copying of a class. The accepted technique is to declare a private copy constructor and a private copy assignment operator, and then fail to define either. Head over and check out more information about defaulted functions on Windows in C++.

Read More

Low-Hanging Fruit: The Top 8 Cybersecurity Vulnerabilities in Enterprise Software

Published December 9, 2020 WRITTEN BY MICHAEL SOLOMON Michael G. Solomon, PhD, CISSP, PMP, CISM, PenTest+, is a security, privacy, blockchain, and data science author, consultant, educator and speaker who specializes in leading organizations toward achieving and maintaining compliant and secure IT environments. Cybersecurity is getting a lot of attention, from the break room to the board room. Few weeks pass without another salacious story in the media about a new large-scale data breach, ransomware outbreak or other attack designed to disrupt normal life.  Cybercriminals know what they are doing, and they’re able to succeed in their goals with uncomfortable regularity. Those goals are increasingly focused on enterprise applications due to the large number of access opportunities that are supposed to support end-users and internal personnel. For example, last year 62 US colleges were targets of cyberattacks that exploited their enterprise resource planning (ERP) system vulnerabilities. Cybercriminals constantly search for easy targets. Expanding complexity, growing numbers of users and partners, and rapidly emerging exploits make security an elusive target. Learning about the most common security gaps found in software, why those gaps really matter, and how to close them can make you less likely to be the next big victim. Instead of approaching security by being as secure as you can be, a better approach is to just be as secure as you need to be. That’s a subtle difference, but the outcome of the latter can be similar to the goal of the former, with much less effort and expense. Let’s cover some rudimentary aspects of security and a basic approach that balances security with budget and effort.  The lure of low-hanging fruit In this article I’m focusing on general cybercriminals who are looking for financial gain. They don’t care who their next victim is. Other types of cybercriminals, such as disgruntled (possibly former) personnel, “hacktivists,” or other people who are targeting your specific data or intellectual property are more determined and motivated to succeed. But here, we’re talking about cybercriminals looking for any victim, so they mainly want a quick and easy attack. Using the path of least resistance is a good thing. The easiest and cheapest path to the bottom line is most commonly the desirable path. Of course, there are reputational impacts and other obstacles that affect the decision-making process, but there is always some appeal to the path of least resistance. Cybercriminals spend a lot of effort identifying the easiest targets. What does this have to do with your security? One important key to being as secure as you need to be is simply avoiding being a hacker’s “low-hanging fruit.” Most cybercriminals use automated scanners to find potential victims they can attack without much work. They look for well-known vulnerabilities that their potential victims haven’t addressed. Cybercriminals know that keeping security controls current takes time and effort, and many organizations have “more important” tasks than hardening systems and networks. This gap between known vulnerabilities and implemented controls defines the sweet spot that cybercriminals are looking for. The best defense from most cybercriminals is to just be secure enough to not be worth their effort. This approach to cyber defense simply means that you should learn about the most common vulnerabilities and fix those first. If you have more budget to go further, that’s great. But at […]

Read More

Quickly Write Efficient Code With Modern Structured Bindings Available In C++17 On Windows With C++Builder

C++17 has a new feature that consolidates syntactic sugar and automatic type deduction: structured bindings. This helps to assign values from tuples, pairs, and structs into individual variables. In another programming language, you can find this as unpacking. Applying a structured binding to specify various variables from one bundled structure is one step. Structured bindings always applied with the same pattern: auto [var1, var2, …] = ; auto [var1, var2, …] = pair, tuple, struct, or array expression>; The list of variables var1, var2 – must exactly match the number of variables contained by the expression being assigned from Then there should be one of the following std::pair std::tuple struct or array The type can be auto, const auto, or even auto&& If you write too many or not enough variables between the square brackets, the compiler will give an error, telling us about our mistake std::tuple tup {3.55, 1, 99}; auto [a, b] = tup; // gives an error std::tuplefloat, int, long> tup {3.55, 1, 99}; auto [a, b] = tup; // gives an error Here is a complete real example of a use case for structured bindings: #ifdef _WIN32 #include #else typedef char _TCHAR; #define _tmain main #endif #include #include #include // Demonstrate structured bindings – here, a method might in the past // have had a bool success result, and an error param written to. // Now, can return both (all error info) as one tuple, bound automatically // to local vars through the auto keyword (much nicer than std::tie // in C++11/14) auto connect_to_network() { // The connection could succeed, or fail with an error message // Here, mimic it failing bool connected{ false }; // failed! std::string str_error{ “404: resource not found” }; return std::make_tuple(connected, str_error); } int _tmain(int argc, _TCHAR* argv[]) { auto [connected, str_error] = connect_to_network(); if (!connected) { std::cout 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 #ifdef _WIN32 #include #else typedef char _TCHAR; #define _tmain main #endif   #include #include #include   // Demonstrate structured bindings – here, a method might in the past // have had a bool success result, and an error param written to. // Now, can return both (all error info) as one tuple, bound automatically // to local vars through the auto keyword (much nicer than std::tie // in C++11/14)   auto connect_to_network() {   // The connection could succeed, or fail with an error message   // Here, mimic it failing   bool connected{ false }; // failed!     std::string str_error{ “404: resource not found” };     return std::make_tuple(connected, str_error); }   int _tmain(int argc, _TCHAR* argv[]) {   auto [connected, str_error] = connect_to_network();     if (!connected) {     std::cout str_error;   }     system(“pause”);     return 0; } As you can see, by using structured bindings, you can write more efficient and clean code. Be sure to check out the official documentation on structured bindings here! Check out the structured bindings demo for C++Builder on GitHub!

Read More

Flexible Multi-Tenancy REST Support Demo For RAD Server In Delphi

It requires InterBase to be installed on the machine or to connect to a remote server. Make sure that the server is running before you run the sample application. With Multi-Tenancy support, a single RAD Server instance with a single RAD Server database connection can support multiple isolated tenants. Each tenant has a unique set of RAD Server resources including Users, Groups, Installations, Edge Modules, and other data. All tenants have custom resources that are installed in the EMS Server. Also, as an administrator you can create new tenants, edit existing ones, add, edit, or delete details of your tenants, specify if the tenant is active, and delete the tenants that you do not need. Location You can find the RAD Server Overview Multi-tenant sample project at: Start | Programs | Embarcadero RAD Studio Sydney | Samples and then navigate to the following: Object PascalDataBaseEMSMulti-Tenancy Demo Subversion Repository: You can find Delphi code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version. Overview This sample application demonstrates RAD Server’s Multi-Tenancy support. RAD Server Overview is a turn-key application foundation for rapidly building and deploying services based applications. RAD Server enables developers to quickly build new application back-ends or migrate existing Delphi or C++ client/server business logic to a modern services based architecture that is open, stateless, secure and scalable. A single RAD Server Overview instance with a single RAD Server database connection can support multiple isolated tenants. This demo uses a chain of toy stores to highlight RAD Server’s multi-tenancy support where each store with its employees and goods is a tenant implementation. Using the RAD Server Multi-Tenant Application The sample application demonstrates a retail store deployment use case. Each store with its employees and goods is a tenant implementation. Employees There are two groups of users with different rights: Managers can add new store items, delete them, and edit the details of the existing ones while cashiers can only view the information about the existing goods. Neither employee can see the information about the other stores in the chain.   Description Now, let us have a look at the sample application. Store Log in Page To access store specific information, enter the following information on the Store Log in page: Toy Store: select a store from the list. Each store is a tenant implementation. Store password: enter the password. Tip: You can find credentials in the Readme.txt file provided with the sample application. Employee Log in Page On the Employee Log in page, each employee enters the following: Employee login Employee password Tip: You can find credentials in the Readme.txt file provided with the sample application. Store Items Page After logging in, each employee sees the store items screen. The screen is displayed in two different modes: edit or view only, and access depends on the employee’s position. This uses EMS groups (a feature of RAD Server) to define access rights. Managers can view, add, and delete the store items and edit the details. Cashiers can view the items’ details only. Please follow the link to the original post for more information: http://docwiki.embarcadero.com/CodeExamples/Sydney/en/EMS.Sample_RAD_Server_Multi-Tenant_Application Check out the full source code for the Multi-Tenancy REST Demo over on GitHub.

Read More