Thank you, all right. Oh, I might need to move this up a bit. Can you hear me? Okay? Yep. Great All right I know you've done this a lot of times today But I also want to know who's in the room and who I'm speaking to so can I get a show of hands for designers and developers? Business owners or like DIY WordPressers any agency owners or people who run a team of devs. Okay, cool I hope you all get something out of this talk. I know the title does make it sound like it's very techie But I do think that the overall message that I want to share today is something that everybody can get something from and at The end I will share exactly what I think each group can learn from my experience on this project so Basically what I want to talk to you today about is this javascript app that we built and embedded in WordPress so the how and why of that I'll go over our technical challenges and how we solve them and Why I think this hybrid approach is something that might be useful for you If you don't know what I mean by hybrid Basically, we went halfway to headless if I can call it that There's been other talks this weekend about the whole headless thing and the gatsby thing So I won't go into all of that our project though. Basically was a mix of both worlds I did this with my partner Hamish. He was Ali developer He came to this project with a strong background in C sharp programming and in javascript but no experience whatsoever with WordPress or even PHP and I came taking the role of sort of front-end design and project leads So I negotiated with the client on the requirements and managed the project So why did we do this? Well? Sometime last year. I was approached by a client who wanted an e-learning membership site or a Subscription-based tutorial platform to be built for Holdouts fitness tutorials and it was actually because of this niche that we came across a lot of custom requirements that it actually led to us choosing this hybrid approach So what my client really wanted were a lot of the usual things to manage subscriptions for a strict content Have tutorials with quizzes attached and obviously be usable on different devices Be easy for the team to upload tutorials and easy for the students to consume them What was interesting though was they wanted this custom design that would support a Different kind of learning experience So the way that pole dancing is taught basically there's not necessarily a linear progressions Not your academic module one lesson one and so forth It's a collection of skills that are linked together in in different ways And we want the students to be able to kind of navigate through that with their own flexible learning path Whoops So immediately I recognize this meant we would need custom post types We've heard a lot about custom post types this weekend So I'd need custom fields and I'd need relationships between these CP2s We'd also need advanced search and filter functionality and also good indexing on all of our Tutorials and the related data so that that search and filter happened quickly Then to support the Personalization aspect we needed to be able to save data about the members activity So what tutorials they watched maybe how many times have they done the quiz did they pass it and from that? We can build custom queries to make recommendations for what they should watch next And last but not least we wanted the UI to be smooth and sleek for the user So we want an experience where they can navigate between these related tutorials really naturally and also find new tutorials that they're interested in So after weighing up all of those things We decided we wanted to leverage the WordPress backend because it's a really powerful CMS And it's got a lot of great plugins that would suit our needs and we wanted to build our own front end So that we could have that single-page app that is fast and beautiful and easy to use But we we we felt that we didn't have the time or the resources to do the entire solution that way So we decided we would embed a fully functional React app in WordPress and then try to make the Transition as seamless as possible for our users. So as they move from the regular pages to the web app We wanted that to feel seamless to them So this hybrid approach really suited the blend of our team skills I came to the project knowing WordPress but had no experience with React and My lead developer was the opposite We'd also done a similar way smaller project before Something that was more like a proof of concept with embedding react in WordPress So we knew it was possible and we were ready to take on this more ambitious project It was also ideal to do the hybrid approach because it meant that we could limit the headlessness if I can call it that again to Just the core functionality. So our e-learning experience Then that enabled us to develop things faster to do a really good job of that UI and then still have room to grow later So that flexibility was really important to us Because we did want to leverage a lot of the other WordPress out-of-the-box solutions for your things like you know membership management payment gateways contact forms and etc We also were able to continue using page builders for the other parts of the website that are more simple home Contact about and my client could go straight into the blog section and be familiar with the WordPress interface and and take care of that themselves So now we know why let's talk about how we did this This was our tech stack the key things really adjust react.js That was what we used for our UI and Wp graphql, which was our data access layer We also then wrote a couple of custom integrations So that Wp graphql could talk to the other plugins that we chose and in our case This was RCP for the membership management facet WP for the search and filter and indexing and Meta box IO, which was our CPT manager of choice. I Don't want to talk too much about why we chose react because you could do this in any JavaScript framework of your choice or vanilla JS I will say though that we founded a pleasure to code in react and I kind of fell in love with JSX just quietly and We also really loved that we could use material UI Which is an implementation of Google's material design that's made for react and that meant we could use like really cool buttons sliders grids poppers and have an attractive UI up and running really quickly I Do want to spend a bit of time on why we chose graphql because this was really the game changer for our project For those of you who are not familiar with with graphql It's it's essentially a more modern alternative to rest and it's Significantly better from a performance aspect It's also really simple to write and execute complex queries with flexible user inputs and It's it supports nested queries and related data really nicely and as you may remember from the requirements All these things were important for us So this was made possible by a plug-in called WP graphql And if you are interested in the rest versus graphql discussion I would check out Jason Baal's Twitter page because there's this interesting thread there We're actually one of our other speakers gets a shout out which I thought was cool All right, so now we have the plan and we have the pieces the path was not without obstacles So let's talk about those First and foremost we found there were limited resources on doing what we wanted to do This is mid to late 2018 and there's a lot of tutorials about going headless But not really about this hybrid idea and definitely not doing it seamlessly So the solution was basically trial and error and a lot of problem-solving in the end our solution was That we made templates a single and a archive PHP with empty DOM container that the app gets loaded into We configured WordPress to route to these templates whenever our slug matched The certain types of CPTs you can see that tutorial for example there And we would in queue our scripts on that slug and DQ any other scripts that we didn't need We also struggled a little bit with The limited dev experience that we had in WordPress coming into the project because both my partner and I I suppose were trying to Run before we could walk almost so we were experienced with programming But we weren't that familiar with the WordPress ecosystem and we found a lot of support for amateur level WordPress problems and in the end what we realized was we weren't asking questions the way that a WordPress developer would And that's why we were sort of struggling to get through that barrier Eventually we found a couple of good slack channels where we got some excellent support from the community So thank you to Jason ball and the WP graph QL team because they showed us the light a lot of times We also Sort of struggled a few times with other plugins We wanted to interact with because they only had PHP or REST APIs The solution there was that we wrote our own integration functions and resolvers so that our we could access their functionality from inside our JavaScript and The maturity of some of our dependencies was an issue as well because I'm thinking material and Metabox and WP graph QL all had features that we really needed now About three six nine months down their release plan So it was just the timing thing for us And what we did there was work with those plugin developers to either provide use cases so that they could you know build in some of the stuff that we needed and understand what we needed it for or We raised pull requests and sort of closed that gap So at the end of the day we did it we embedded a fully functional react app in an otherwise completely standard WordPress installation And it was beautiful Now we're doing some refactoring so we do need to consolidate our data access our component tree We've got about three different design patterns from trying to put this together over such a short amount of time We did have a small team just us to working after hours We had full-time jobs and we had a very very hard deadline for launch So we also need to now upgrade some of those dependencies that have kind of caught up if you want to call it that to sort of our needs and After that we would love to translate more of the project into the app scope Which I think will be really exciting now that WP graph QL is part of Gatsby We're interested in looking at how we can use that for that other parts of the site that aren't e-learning component and Maybe after that we could look at translating some of our react that JS to react native and possibly offer a companion phone app or something like that We also want to continue our open source contributions And we intend to publish a blog or two about how we did what we did So if you are interested in more detail or code snippets or any of that sort of thing Please get in touch with me. My details will be on the last slide So now we know the how the why and then what's next I just want to finish up by sharing what I really loved about it and why I think maybe you would like to try it too So it was great for us because we got the best of both worlds We got to design our front end in the MVC design pattern. So your model view controller, which was discussed yesterday and We still got to use page builders for everything else outside of that Component and even for rapid iteration of mock-ups for things that we were going to build in our custom UI We found front end development relatively hassle free Which compared to my previous experience developing for WordPress was kind of a breath of fresh air I don't know about everybody in this room, but I generally find it's a mix of convoluted PHP templates CSS overrides that can get very messy jQuery version conflicts or all that sort of fun stuff So it was really nice to be able to develop something for WordPress in a clean and more modern way I also actually found a someone new to react that the react learning curve was shallower than I expected Case in point about six months after launch. My client presented me with new mock-ups So we're gonna get a nice new facelift on the site and I managed to reskin the whole app in Far less time than it took me to do the rest of the WordPress site And that was a lot to do with material and their excellent theme engine But it wasn't just style that we were editing. There's a lot of layout changes, too so the modular component thing and The convenience of JSX all that just made sense to me and it made for a faster development time and I loved it Also loved WP graph QL That was a very very clean and user-friendly way to query our data and it was especially convenient with this graphical IDE which I called graphic QL for my entire time up until I realized Graphical is much much better way to pronounce that That makes so much sense. It's like a graphical version So this is this is a really handy little thing you can stick in your double UP admin And you can run your queries see the results like this You can actually explore your objects so you can go through and see the fields and what they're implementing and stuff like that Which is very handy And ultimately we loved it because the client loved it They were impressed and happy the end result was fast and smooth and intuitive and Looked great and came in on time and on budget So I don't know what else you could want Why you might like it though? So I talked about why it fit all of our requirements and perhaps that's not something that you sort of have the same needs For but I still think the hybrid approach is worth considering If you're a business owner, it means that you can update your website bring in advanced functionality custom designs improve performance without doing the whole website as an app So if you've been interested in this idea of this single-page app sort of headless WordPress You don't have to do it all or nothing. You can go hybrid and you can do it bits and pieces Same applies for a designer and a developer. You can tackle upgrades incrementally. You can up skill yourself progressively take something like the image gallery or the blog section and Make your single-page app for that load your JS on that page and you're cooking Also, if your goal is to go headless I feel like this can be a good stepping stone and it can put you on the path to perhaps developing software solutions that are a WordPress back-end and a phone app front-end If you are an agency owner or in a mixed-mode team I think it's really cool because you can have each player working in the ecosystems that they are already familiar with and Yet still be solving problems with modern tools and modern methods And if I can sum it up in a nutshell, it's just about giving yourself more options There's been a lot of talk this weekend about, you know, it's a new time for WordPress and and all this sort of thing And I truly believe that I think that everyone can benefit from modernizing their WordPress sites Without while still keeping their existing sites running and I think it's great to explore alternatives to these big Overhauls that might run over time or over budget or just never happen So yeah, I think that you should consider a hybrid approach for your next project It might be a quicker or cheaper or more agile alternative Thank you very much Do we have any questions? Thanks, Georgia. That was a great talk. Thank you I can't wait to see what you've built for your clients sort of productized and made available because It's a sort of thing that sort of I think could be really successful. So good on you My question was around you sort of touched on briefly about how you Had your a bit of time when it came to, you know, you needed features that weren't yet available And you touched briefly on what you did to go about getting those features But I was hoping you could expand a little bit more on that From my perspective is at the other end Is as a plugin developer Trying to meet those requirements from the users. Yeah, and I'd like to hear what worked Well, I'll use WP graph QL as the example because Essentially what we found there was Jason the plugin developer was really interested in the way that we wanted to use the his graph QL They were using it for I think news distribution and like syndicated blogging and this kind of thing So our use case with this whole Tutorials that are related to each other and quizzes and user data that was saving just wasn't something that was a use case that He had built graph QL WP graph QL to do so he was I think we were just very very lucky He was already interested in introducing a lot of these things It just was a matter of we did a little bit of the grunt work with some of use cases And and my lead developer did do a lot of the coding anyway and raise PRs And yeah, I think that we were very fortunate I do know that in other cases a plug-in developer can't cater for all these expanding needs Well, that's how we handled it cool. I Would just then say that I'd echo that is a really good idea Even if you don't have the technical ability to raise a PR That what your tip there on just telling the developer the use case is super helpful. Mm-hmm. Definitely Thank you Anybody else? Oh and on your comment that you'd like to see how it's productized I did regret that I didn't put more screenshots in and show some more about What the solution we built and it is obviously highly niched for the poll fitness thing, but I do think it's a Structure that that can be applied more widely. So if anybody is interested in something similar I would really like to talk to you. Thank you


Welcome to the Hindu News Analysis by Shankarayesh Akademi, the displayed articles have been chosen for today's analysis from Chennai, Bengaluru, Delhi, Hyderabad and Tiruvannanthapuram editions. Now let us start our discussion. This article mentions that the Gemini device was launched by the Ministry of Earth Sciences. Therefore, before understanding the system of Gemini, the syllabus linking of the topic is given here for your better understanding. Now that India already gives the weather forecast and issues weather advisories to fishermen, but this information is disseminated through multiple mobile modes and none of them could provide information like the disaster warnings when the fisherman move away from the coast beyond 10 to 12 kilometers and it was a major limitation in disseminating the information to fishermen who wenches into the sea beyond 15 nautical miles. Note that here one nautical mile is equal to about 1.8 kilometers and this limitation of no communication beyond 10 kilometers from the coast was particularly felt during the Cyclone Oki in 2017 which has affected the coast of Kerala. The fisherman went out for deep sea fishing before the onset of Cyclone and they could not be informed on real time basis. To overcome this difficulty, Indian National Centre for Ocean Information Services insured Inquoise collaborated with the 8th port authority of India to utilize the Gagan satellite system to transmit the disaster warnings to fishermen. Here note that Inquoise is an autonomous body located at Hyderabad under Ministry of Health Sciences. The mandate of Inquoise is to provide the ocean information and advisory services to society, industry, government agencies and also to the scientific community. This information is provided based on continuous ocean observations. Now before discussing Gemini system, now recollect about Gagan satellite system. One is the acronym for GPS Aided Geo Argumented Navigation Satellite System. This system consists of 3 geosynchronous satellites which are GSAT 8, GSAT 10 and GSAT 15 and this satellite system covers the entire Indian ocean on real time basis. Now in order to receive messages that are transmitted through the Gagan satellites Inquoise and 8th port authority of India together develop this Gagan system enable Gemini. Gemini is the acronym for Gagan Enabled Mariner's Instrument for Navigation and Information and it is a portable receiver that is linked to Gagan satellites. It is a box shaped receiver that has an antenna and inbuilt battery and this battery can last for 3 to 4 days. The Gemini device receives and transfers the data received from Gagan satellites to a mobile through Bluetooth communication. A mobile application has been developed by Inquoise and this mobile application will decode and display the information in 9 regional languages at present. Now let us look at the important benefits of using Gemini system. One is that it provides seamless and effective dissemination of emergency information and communication on disaster warnings. It will also provide information of potential fishing zones. It will provide the accurate state of the oceans also. It includes the forecast on the winds, waving pattern, ocean currents, water temperature and so forth and so on on real time basis. Further this news article mentions that the cost of one Gemini device is about 9000 rupees and it is relatively expensive for the fisherman and this article also mentions that plans are also available to subsidize the Gemini system or Gemini device in simple terms by as much as 90% so that it becomes very affordable to the fisherman. So with this information we end the discussion of this topic. Have a look at the practice question and this practice question would be discussed at the end of the session. Now let us move on to the next article. This is an editorial topic chosen for today's analysis. With respect to this article we will be discussing how the new indexation of NREGA wages that is National Rural Employment Guarantee Act wages is actually affecting the poor and how the reduction in the corporate tax rates is benefiting the rich. And we shall also see certain measures listed out by the authors for the government to address this situation. Without better understanding of this editorial the syllabus linking of the topic is given for your reference. The authors of this editorial is saying that the central government has made two recent announcements to mitigate the economic crisis. One is regarding the new indexation of NREGA wages which is meant to increase rural income. The second is that reduction in corporate tax rates and the authors have linked how the new indexation of NREGA wages is affecting and how the reduction in the corporate tax rates is benefiting the rich. The authors are telling that both these announcements made by the government are at the two ends of the spectrum. First let us see regarding the new indexation of NREGA wages. See there was an announcement by the central government about the linking of wages under MG NREGA that is Mahatma Gandhi National Rural Employment Guarantee Act in order to revise the inflation index associated with the payments of the wages of this act. It means that the wages should be fixed as per the current trends of inflation. Here note that the present national daily average NREGA wage is about 179 rupees. The authors of this editorial tell that NREGA daily wages are to be indexed with an updated inflation index called as consumer price index rural instead of older index which is consumer price index agriculture laborers that is CPI AL. The calculation of CPI AL involve more food items in the consumption basket while the calculation of CPI OR that is consumer price index rural involves more non-food items such as health care, education and such other measures. So CPI OR is more inclusive since it contains non-food items as well also. Therefore CPI Rural reflects the rural consumption basket better when compared to CPI AL that is consumer price index agricultural laborers. The authors are also telling that the linking of NREGA wages with CPI Rural will have some impact only if the base NREGA wages are high. So the authors suggest that a substantial increase in NREGA wages is required and also NREGA wages should be linked with consumer price index rural. The combined effect of these measures would have positive effect on rural people and also on the economy. But at the present situation is that only three states of India have the NREGA wages which is equal or more than the state minimum wages. In rest of the states NREGA wages are still lower than the state minimum wages. You know that as per the law enforcing minimum wages is a legal responsibility because they are fixed by calculating the minimal nutritional requirement and basic needs of an individual. But the present fact is that the current daily NREGA wages are quite low. The present NREGA wages are roughly a quarter of what has been fixed by the Seventh Pay Commission. And also let us see now that how the corporate tax rate cut would be affecting the economy. From the authors point of view the recent corporate tax cut will only widen economic inequality. They have cited that Oxfam inequality report 2018 as per this report in one year the wealth of the richest one percent in India grew by about 21 lakh crore rupees. This money is equivalent to the 2017-18 budget of India. And one more thing is that the budget allocation of NREGA gets exhausted by October of each financial year as per the authors of this article. This is one of the reasons for delayed payments of NREGA wages. Further the authors have mentioned an IMF report released in 2015 as per the report if the income share of the top 20 percent people that is the rich people increases then the GDP growth actually declines over the medium term. But at the same time an increase in the income share of the bottom 20 percent that is the poor people is associated with higher GDP growth. You know that in the current scenario the corporate tax cuts and lower interest rates would give some liquidity that is a money flow to the corporations. But the authors also mentions that this is not likely to increase the rural demand. But on other side authors tell that without a substantial increase in NREGA wages the wages would barely match inflation levels. So this would lead to a condition of wage stagnation in real terms. The authors finally tell that the present ruling party seems to support the super-rich by announcing measures like corporate tax rate cuts. They also mentions that it is the duty of the government to pay attention and give some kind of support to the poor on economic aspects, legal terms and also it is the ethical responsibility of the government to give more attention towards weaker sections of the country. Kindly note that the present scenario regarding the wages for agricultural laborers is also very less. They tell that if the wages remain unsustainable then the poor would be forced to become part of migrant labor force. So the poor will ultimately suffer because of this VC cycle of migration. So from this editorial the authors try to tell that the development should be focused on the poorer sections of the society instead of benefiting the rich sections who are already enjoying many benefits. So the minimum wages should be guaranteed which would help the workers and also the Indian economy in turn. So with this we end the discussion of this editorial. The displayed practice question would be discussed at the end of this session. This article says that India slips 10 places in global competitiveness index. To understand better about this index, first understand the syllabus linking of the topic given here. With respect to this news article, we will look at the global competitiveness index in UPIC dimension. The report says that India has slipped from 58 position in 2018 index to 68 position in 2019 ranking. Finally note that such kind of global indices, the organizations or the institutions releasing such kind of reports or indices is very important for your plumes exam. Here the mentioned index of this news article is released by the World Economic Forum that is WEF. The index attempts to quantify the impact of number of factors which contribute to create the conditions for competitiveness such as the macroeconomic environment, the quality of countries institutions and the state of countries technology and also supporting infrastructure. It is to be noted that this index is based on 12 major pillars of competitiveness. The important pillars are institutions, infrastructure, macroeconomic environment, health and primary education and such other indicators. Now let us come back to the news article. It is to be noted that Singapore replaced the years as the world's most competitive economy. We have already discussed that India witnessed a fall in ranking in 2019. The article says that a major reason for this can be improvement witnessed by several other economies. According to the index, India is the worst performing BRICS nation except Brazil. Brazil is ranked 71st position in the index. Let us now discuss something about the indicators in which India has performed better and where it needs improvement. India ranks high in terms of macroeconomic stability on market size. The macroeconomic stability is based on factors like GDP, inflation rate and government debt. In the case of the market size, it measures both the foreign market size and also domestic market size. Here the article says that the financial sector in India is relatively deep and stable. This indicator is based on the efficiency, stability and trustworthiness of the financial and banking system. India has performed well in terms of corporate governance also. The news article says that India is well ahead of most of the emerging economies when it comes to innovation. India is also at par with several advanced economies in this indicator. It is based on the quality of scientific research institutions, spending on research and development, university industry collaboration and availability of scientists and engineers. Now let us discuss the shortcomings. India is ranked poor in adoption of information and communications technology. It comes under the pillar of technological readiness. It is based on availability of latest technologies, use of internet and broadband internet subscriptions. India is also performed poor in health indicators. It is based on healthy life expectancy, infant mortality rate. The article says that India's performance in this indicator is below the South Asian average. Now, the news article discusses the factors that pulls back India in terms of goods market efficiency and labour market efficiency. The goods market efficiency is undermined by lack of trade openness. It is based on factors such as tax rates, proceeds to start business and trade tariffs. The labour market efficiency suffers from lack of protection of workers' rights, insufficiently developed labour market policies and very low participation of women. So India needs to improve in all these areas for ensuring better competitiveness in the future. Now, let us discuss about the World Economic Forum. And this World Economic Forum was established in 1971 as a not-for-profit foundation and it is headquartered in Geneva, Switzerland. It aims to improve the state of the world by engaging business, political, academic and other leaders of the society to shape global, regional and industry agendas. It releases reports such as global competitiveness index, global gender gap reports and such other reports. With this, we come to the end of the discussion of this topic. The displayed practice question will be discussed at the end of this session. Now let us move on to the next article. This article says that recently two children from the schedule caste community were beaten to death in Shivapuri district of Madhya Pradesh. So before going to discuss the topic in detail, just go through the syllabus linking of the topic given here for your better understanding. Now consider the article itself. The article says that the children were accused of defecating in open and were beaten to death. The two accused persons belonged to the Aadava community. After the incident, there were allegations of caste-based discrimination in the village school. According to the news article, a relative of the victims alleged that the students from Meher community, which is a scheduled caste community, were not allowed to sit with Aadava children in the school. This prompted the district authorities and the members of the National Commission for Scheduled Caste to inspect the village. The team has said that they did not find any signs of caste discrimination in the school. They said that all the students were sitting together in the class. You know that when there was a caste discrimination in such kind of schools, students belong to certain caste will be made to sit separately. Further, the team also said that all had equal access to public places. So in this context of the article mentioned, we will be discussing in detail about the National Commission for Scheduled Caste. The National Commission for Scheduled Caste is a constitutional body established under the Article 338 of the Constitution of India. You know that before 2003, there was only one commission for both scheduled cast as well as scheduled tribes. But after the 89th Constitutional Amendment Act 2003, it bifurcated into two separate bodies, one for National Commission for Scheduled Caste under the 338 article and one more separate constitutional commission that is National Commission for Scheduled Tribes under Article 338A. Now let us discuss the structure of the commission. The commission consists of a chave person, vice chave person and three other members. Note that they are appointed by the president and the conditions of the service and the tenure of the office are also determined by the president. Their tenure is about three years including for the chave person. The members shall not be eligible for, appointment for more than two terms. Now let us discuss the pros and cons regarding the resignation and the removal of the members. Any member can resign by addressing his or her resignation later to the president. In case of removal, the president shall remove the chave person or the members only on the grounds of proved misbehavior. This should be only after an inquiry made by the Supreme Court into that matter. Moreover, the president can also remove on the following grounds such as if he or she is a judge and insolvent or engaged during his term of office in any paid employment outside the duties of his office or unfit to continue in the office by reason of infirmity of mind or body or has so abused the position. Now let us discuss some of the functions of the commission. The commission can investigate and monitor all the maters related to the safeguards provided for the schedule cast under the constitution or under any order of the government and also can evaluate the working of such safeguards. The commission shall inquire into specific complaints with respect to the deprivation of the rights and the safeguards of the schedule cast and also the commission have to participate and advise on the planning process of socio-economic development of the schedule cast and to evaluate the process of the development under the union government or any such state governments also. Here note that the commission submits the report to the president but not to the respective ministries. Now let us discuss the post of the commission. The commission has all the posts of civil court while investigating into the complaints like it can summon and enforce the attendance of any person from any part of India. It can require the discovery and the production of any document, requisition of any public document or copy thereof from any court of the office. It is to be noted that according to article 338 class 10 the National Commission for Schedule Cast has to investigate all the matters relating to the constitutional or other legal safeguards for the other backward classes and also for Anglo-Indian community and the commission is expected to submit the report to the president. But the 102nd Constitutional Amendment Act says that the pros and related to other backward classes in class 10 shall be omitted and the amendment act establish separate national commission for backward classes. Now note that it applies only to Anglo-Indian communities. So with this we have come to the end of discussion of this topic. The displayed practice question will be discussed at the end of the session. This article is about the improper maintenance in pipeline associated with Copley hydroelectric project. It is alleged that as a result of the improper maintenance due to pipeline rupture four persons were missing. Many reports are saying that the persons might have died as they might have been washed away by the water flow. The syllabus relevant for the analysis of this news article has been highlighted here for your reference. Recently we have been seeing damages to human lives and property from some of the power plants and power generation projects. On 8th October 2019 we discussed about the fly ash leak in NTPC power plant in Singarali district in Madhya Pradesh. Some two months ago in the same district there was a fly ash leak from the SR power plant. NIPCO was incorporated in 1976 as a central government owned public sector enterprise under the ministry of power. The purpose of establishing the CPSC is to carry out activities involving both hydro and thermal power stations for the development of hydroelectric potential in the northeastern region. NIPCO is mandated to construct, generate, operate and maintain both hydro and thermal power stations. The government sources say that NIPCO is the only central public sector undertaking that has both hydro and thermal power stations in operation. You know that it is a Mini Ratna Category 1 CPSC. Here you should know the eligibility criteria for Mini Ratna Category status. When we talk about Mini Ratna Category 1 we should know the criteria for the grant of the status. There are three main categories or criteria. One is that CPSC's should have made profit in the last three years continuously and then pre-tax profit should have been 30 crores or more in last at least one of the three years. Then they should have a positive net worth. There is one another category under the Mini Ratna status that is Mini Ratna Category 2. The one main difference in eligibility is that here for Category 2 there is no requirement for prescribed pre-tax profit. Note that for the CPSC's coming under schemes such as Mini Ratna, Navratna and Maharatna, the boards of these CPSC's will be given enhanced autonomy and financial powers. Now let us see about Kopili Hydro Power Project. This power project is located on River Kopili in the Assam. It is the first project of NIPCO. The total power generation capacity of the hydroelectric project is about 275 megawatts. The reservoir across Kopili River is called as Kopili Reservoir or Khan Dang Dam. Another reservoir is located on Umrang Stream which is a tributary of Kopili River. This reservoir is called as Umrang Reservoir. Note that River Kopili is a perennial river. It originates in Barail mountain range and has a total length of about 290 kilometers. And finally it confluences with Brahmaputra. As a result, River Kopili is also called as South Bank tributary of River Brahmaputra. Water from these reservoirs are taken to concerned power stations through appropriate huge pipelines. One of these pipelines have ruptured or broken and as a result of this rupture, a lot of water has leaked and entered a poor house of this hydroelectric project. Several news reports are saying that the water flow of about 2000 liters per second in the pipeline might have washed away the four persons working in the project. And these persons are the employees of NIPCO. And some other reports also saying that the persons were missing and untraceable and might have died. The news article mentions that only in the last year, the pipeline was repaired. There is an allegation that this repair if done properly, it would not have led to the burst and the tragedy. The affected people are questioning the authorities, who carried out the repair works and those who gave the certification after the completion of repair works. This will help in fixing the accountability in the government process for the tragedy. From the analysis of this news article, you know that there is a dedicated electric power corporation for northeastern region, which was established way back in 1976. Then know about the eligibility criteria to become Mini Ratna category one status and then about the Kopli Perennial River. So with this information, we end the discussion of this topic. The displayed practice question will be discussed at the end of the session. Now let us start discussion of practice questions. The question is about Gemini device and here two statements are given. First statement is about the benefit of the device and the second statement is about who has developed the device. So the first statement says that the device developed to provide seamless and effective dissemination of emergency information. And we have seen from our discussion and mentioned statement one is the objective of and also benefit of the Gemini device. Therefore statement one is correct. From our discussion, we have seen that the device has been jointly developed by Inquoise along with Airports Authority of India. Therefore statement second is also correct. So from the options given, option C that is both one and two is correct. Here the question is about which of the following can contribute to the increase in the rural consumption demand. They have given three reasons and we have to choose the correct answer from the course given below. Now consider the statement three. Here higher interest rate for loans by the banks. You know that higher interest rates may not increase the rural demand for consumption. Therefore the statement three is incorrect. So if statement three is incorrect, you can remove the option C and D. Now consider the second statement. The statement says that tax rate cuts by the government as a reason for increasing the rural consumption demand. So here the tax rate cut also increases the money in the hands of the people. Therefore the second statement is one of the reasons for creating the consumption demand in rural areas. Since the second statement is correct and third statement is incorrect, thus the correct option is option one and two only. That is option D. Now consider the question. Here the question is that which of the following is released by the World Economic Forum. So from our discussion we have clearly seen that the global competitiveness report is released by the World Economic Forum. And also you know that global financial stability report and ease of doing business index and rule of law index is not released by the World Economic Forum. But World Economic Forum also releases one of the important global general gap report. Therefore for this question option A that is global competitiveness report is correct option for this question. Now consider this question. Here the question is with reference to National Commission for Scheduled Caste. The question is based on how the members of the commission are appointed. From the topic analysis we have seen that the members of the commission including the chairperson are appointed by the president and there is no role of committee headed by prime minister. Therefore the statement one is incorrect because the statement one says that the members of the commission are appointed by the president on the recommendation of a committee headed by the prime minister. Now consider the second statement. It says that the commission has the power to investigate all matters relating to the constitutional and other legal safeguards for the other backward classes and the Anglo-Indian community. Note that one or two amendment act of the Indian constitution excluded OBCs from the National Commission for Scheduled Caste. Therefore at present the National Commission for Scheduled Caste is also having the same kind of power to investigate all the matters related to the Anglo-Indian community alone. Therefore the second statement is also incorrect. Thus the correct option for this question is option D neither one nor two. Now consider this question. This question is with respect to Kopili hydroelectric plant. From our analysis we have discussed that Kopili is a perennial river and is a tributary of Brahmaputra in the state of Assam. The both the statements are correct. The correct option is that option C both one and two are correct. You may think that this question is not relevant for the UPS exam. But look at the UPSC 2019 previous prelims question. They have asked the words like aliar, isapur and kanksabati and they ask that what is the common to these places. For this question option D is correct because the mention words are related to the places of water reservoirs. With this we come to the end of the practice questions discussion. Thank you.


Bring your time today with me. Today we are going to talk about the open policy agent and specifically how the open policy agent can allow you to enforce dynamic policy enforcement for microservice environments. A bit about me, I am Ash Narkar. I am a software engineer at Styra. I am one of the maintainers of OPA. And I'm excited to be here today. So let's get started. So we will first see OPA's community. And then we will talk about OPA itself, what is OPA, talk about its features, use cases. And then we will do a deep dive into a microservice API authorization use case. So OPA, which is the open policy agent, was started at Styra in 2016. And the goal of the project has been to identify policy enforcement across the stack. One of the earliest adopters of OPA was Netflix. And they've been using OPA for authorization for their GRPC and HTTP APIs. And there are a bunch of other companies, like Medalia, Chef, Pinterest, Intuit, who are using OPA for a variety of use cases, like AP authorization, RBAC, ABAC, Admission Controls, Risk Management, and so on. OPA is a CNCF project. And it's currently at the incubation level. We have more than 100-plus contributors on Git. It has a healthy Slack community of more than 2,500 members. And it has more than 3,500 stars on GitHub, which shows a lot of people are adopting and started using OPA. And OPA is integrated with more than 20 of the most popular open source projects out there. And we will see some of them later. So what is OPA? OPA is a jungle-purpose policy engine which you can use to offload your policy decisions. So the idea here is to decouple the policy enforcement from the policy decision making so that your services can offload policy decisions to OPA by executing a query. So let's try to understand this concept using this figure. Imagine you have a service. And this can be any service at all. It can be your Kubernetes API server. It can be your custom service. Or it can be your Kafka, anything at all. Whenever your service gets a request, your service is going to ask OPA whether this request is allowed or not by executing a query. And this query can contain information like the method, the path, the user, basically any JSON data. And so what OPA does, it evaluates this query based on the policies and based on the data that is loaded into it, makes a decision, and sends that decision back to your service where it gets enforced. So this decision, again, can be any JSON value. It can be a Boolean. It can be a composite value, and so on. So you can see from this picture that we are trying to decouple the policy enforcement, which happens at your service, with the policy decision making, which happens on the OPA side. So let's look at some of OPA's features. At the core of OPA is a high-level declarative language called as Rego. And what Rego does, it allows you to write policy decisions which are more than Boolean, more than allow denied through false. So for example, you can ask a question, what field is a user allowed to see? And you can write a policy which returns those fields. Or you can ask a question, what servers can this workload be deployed on? And OPA can return you the list of servers on which the workload can be deployed on. So you can see it's more than just yes, no, through, false, allow denied. It's much more than that. You can return objects as policy decision sets any JSON value. OPA is written in Go. And it's designed to be as lightweight as possible. You can deploy OPA as a sidecar, a host-level daemon, or you can integrate OPA into your Go application as a library. Typically, your OPA and your application will reside on the same machine. And this is done so that you get high availability and low latency. You can think of OPA as a host-local cache for your policy decisions. OPA does not have any runtime dependencies. So if it has to make a decision, OPA does not have to go out and talk to an external service or talk to an external database to make a decision. However, you can extend OPA to do that, but that's completely optional. OPA does allow you to pull down policies and data from your external service by using its management APIs. It also allows you to upload status about what's going on with the OPA agent itself to an external service. And most importantly, it allows you to upload decision logs. What actually happened? How OPA made that decision? What was the input to the decision? It allows you to upload these decisions to an external service where they can be analyzed offline and used for other kinds of analysis. And finally, along with the core policy engine, OPA provides you a rich set of tooling which you can use to build, test, and debug your policies. It gives you a unit test framework which you can use to test your policies before actually putting them in production. It allows you to profile your policies to see where they are going wrong or what part of the policy is slower. It allows you with tracing and profiling tools to enable to do that. And also, it has integrations with IDEs like VS Code. And there's one coming up with IntelliJ which is going to help you to author your policies. So these were some of OPA's features, declarative language, multiple deployment models, management APIs for control and visibility, and a rich tooling set. So like I mentioned before, OPA is integrated with more than 20 plus open source projects out there. And this is just a snapshot of those projects. One of the hottest use cases for OPA is Admission Control in Kubernetes. So if you guys are familiar with Admission Control, it's essentially a piece of code that intercepts requests to the Kubernetes API server before that request is actually persisted in HCD. So using OPA as an Admission Controller, you can write really fine-grained policies. For example, a container should not use the latest tag in the image. Or if your container is pulling down images from Docker Hub, you want to probably avoid that. Or if your containers or if your deployments are not specifying any CPU or memory limits, you can also stop that at Admission Time using OPA before that workload actually gets deployed inside your cluster. Another use case integration is with OPA and Linux Spam where you can perform fine-grained authorization over SSH and pseudo using the Plugable Authentication Module. OPA is also integrated with Kafka, Elastic Search, SQLite, Minio. And in the case of Kafka, there are some topics which have high fan-out. And you probably don't want people to write on that topic because it's gonna be consumed by many consumers. So if you want to control who can write to such high fan-out topics, you can use OPA to enforce those kinds of policies in Kafka. And finally, OPA is integrated with a bunch of service mesh projects like Istio, LinkerD, Envoy for API authorization. And we will look at this particular use case in detail a bit later. So the cool thing I need to point out here is that you can use any of these integrations out of the box without having to write a single line of code. So you can take these integrations and start enforcing policies today using OPA. So now let's go to how does OPA actually work? So we've seen this figure before. You have your service, it gets a request. It asks OPA for a policy decision. OPA gives a decision based on the policy and data it has access to and sends it back to your service for enforcement. So let's take a sample policy in English and try to write that in Rego and enforce it with OPA. So the policy in English says that employees can read their own salary and the salary of anyone they manage. So let's see how we can take this policy and write some Rego. So like I said before, when your service asks OPA for a policy decision, it has to send some field or it has to send some information in the input. So imagine for this use case, for this example, the service sends the request method, the request path and the user who's making the request. So one thing I want to emphasize here is that OPA does not do authentication. It's not trying to solve the problem, it's Bob who he says he is. It's trying to solve the problem what is Bob allowed to do. So with that being said, let's try to see how we can enforce this policy which says employees can read their own salary and the salary of anyone they manage. So to do this, I'm going to use the Rego Playground. And the Rego Playground is this awesome online tool which you all can use to experiment with your Rego policies and test out and share your Rego policies. So this is what the Rego Playground looks like. It's available at play.openpolicyagent.org. You can see that there is good syntax highlighting for your Rego code which makes it easy to read your code and has to debug the code as well. So the way you read this policy is that the rule allow is true if input.method is get and input.path is salary employee ID and input.user is employee ID. The cool thing about this policy is that the employee ID variable on line seven and line eight will be bound to a value from the input. So let's give a sample input to this policy and see how it works. So here in the input pane, I have some sample input for this policy where in my method is get. I have a path salary Bob and I have a user called Bob. So the question we are trying to ask OPA is Bob allowed to see his own salary? And if I evaluate this now, the result is true which means OPA says Bob is allowed to see his own salary. So what happened here is that the input method was get. The employee ID variable got bound to Bob and on statement eight, your user is Bob and the employee ID is Bob. So all the statements on line six and seven and eight were true. As a result, the allowed rule was true and that's what you get finally. So let's try with a different user. Now let's say Alice is curious about Bob's salary. So let's see what happens if Alice tries to see Bob's salary. So the question we are asking OPA is can Alice see Bob's salary? So if you evaluate it now, the result is false and the reason it's false because on line eight, the user is Alice and the employee ID is still Bob. As a result, this expression failed which caused the overall rule to fail and which is what we wanted, right? We don't want anybody to see Bob's salary except for Bob himself. So that's the first part of our policy which says that an employee can see his own salary. So now let's say Alice gets promoted and she becomes Bob's manager. So the policy says that a manager should be able to see the salaries of employees she manages. So we need to tell OPA this new information. We have to communicate to OPA that Alice is now Bob's manager. So how can we do that? So you can see this data plane. We can just give some sample data to OPA in this pane. For example, let's say managers is an object and let's say for Bob, Bob's manager is Alice and say Fred and let's say Alice, her manager is Fred. So what we've done is we are giving some data to OPA which kind of encodes the company hierarchy out here. And so you can imagine that this data can be given to OPA via your LDAP server or this data can be stored somewhere externally and you can ask OPA to pull it down during the policy evaluation. So but for the purposes of this example, we can simply provide data to OPA using this data pane. So what we can do now is we can extend this policy to make use of this new data. So managers and okay. So what we are saying now is that if the person making the request is the manager of the person with the salary they want to see, allow this request. So again, the question we ask is can Alice who is Bob's manager allowed to see a salary? So if I evaluate this and if I have typed correctly, the allow rule should evaluate through. So this is because even though the first allow rule was false, the second allow rules, all these statements line 12, 13 and 14, all these statements were true and as a result the allow rule was evaluated to true. So meaning in Rego, if you have two rules with the same name, it's essentially an or condition. So now that we've written, so this was the second part of our policy which said that a manager should be able to see the salary of users they manage. And so we can take that simple policy in English and very simply write a simple Rego policy which encodes that. So now that you've written your first Rego policy, you can share this policy with the entire world with friends and family by clicking the publish button and it gives you this beautiful link which you can copy. And then if you open that link, you not only get the policy that you authored, but you also get the input as well as the data that you sent to your policy. So again, if you evaluate this, it should evaluate to true and now you can share these policies in blogs or in posts or with your family and friends and share them throughout the world. So this was how you can use the Rego playground to write, to experiment with Rego policies and to share them. So we just saw how we could take that simple policy in English and write a Rego rule around that. So next, let's talk about a use case around API authorization. So we spoke about OPA can be used for multiple use cases like admission control, it can be used for RBAC, ABAC and one of the popular ones currently is API authorization. So microservices provide the productivity of individual development teams by breaking down applications into smaller standalone parts. And hence, many organizations are adopting microservice oriented architecture to design and build their software systems and use public cloud for deployment. However, microservices alone do not solve age old distributed system problems like service discovery, authentication and authorization. In fact, these problems are often more acute due to the heterogeneous and the ephemeral nature of microservice environments. Applications that are architectured as microservices have a huge problem. Imagine you have tens or hundreds or even thousands of microservices and each microservices has to decide whether one of their thousands of API calls per second are authorized or not. So you can understand the magnitude of this problem. In fact, Netflix, who is one of the leaders in microservices talk publicly about how important fine grain authorization actually is and how strict the performance and the availability demands are at scale. So what we need is a unified way of understanding and controlling the authorization policies enforced by hundreds of polygons services, tens of different data storage systems and a flethora of supporting software that are running across different clusters and even different data centers. I hope we understand at this point we cannot simply hardcore these policies into all these microservices because it's going to be a management nightmare when you start to scale this. Because every time your policy is updated, you now need to update your entire service which makes it really difficult and makes it expensive. So the solution must not only give us the correct authorization decision, but it has to be highly performant. Any guesses for what that solution is? It's OPPA. That's what we're here for. So yeah, you guessed it. The solution to this is OPPA. So OPPA was designed for architectural flexibility so you can integrate it seamlessly throughout your application stack from the UI to the gateway to the backend to the database. You can choose high availability and performance by distributing OPPA to the edge or you can choose strong consistency by integrating OPPA into a central service. So let's focus on integrating OPPA with your backend services. Now given that OPPA has multiple deployment models, you can do this in different ways. You can integrate OPPA as a library in your backend service, but this would require your backend service is written in Go. You can run OPPA as a service and have your backend service call out to OPPA on every API request. This is good, but if you're in a microservice environment and you care about latency and availability, you're going to have to pay for this network call on every single API request. And lastly, you can integrate OPPA with your service mesh or your network proxy so that you can enforce policy without changing the backend service at all. So let's see an example of this last approach using Envoy. Now for those of you who are not familiar with Envoy, Envoy is basically a Layer 7 proxy and a communication bus designed for large modern service-oriented architectures. So let's imagine you are deploying your application on top of Kubernetes and inside your application pod, you have your application container and you have an Envoy Sidecar running as well. So the way this typically works is that when your application gets a request, it's going to be intercepted by Envoy. And Envoy is now going to send this request to your microservice, to your application, get the response back from your application and Envoy then sends it back to your client. So you can take the same architecture, the same flow, and now you can inject OPA in this flow. So the way you do that is now when you get a request, Envoy has an external authorization filter which can take that request and send it to an external authorization service to check if that request is allowed or not. So this feature makes it possible to delegate authorization decisions to an external service. In this case, that service is OPA and provide all the request context to this external service. So Envoy is going to send OPA the request, the path, the user, any different kind of information that is coming in the request. All that information can be sent now to OPA. So OPA can now use this information to make an informed decision and send that decision back to Envoy for further processing. If OPA denies the request, Envoy sends a 403 back to your client. If OPA allows the request, like before, Envoy sends the request to your microservice application, gets the response back and forwards that response back to your client. So in this example, you have intercepted the incoming request coming into your pod using the filter for external authorization and then fetching the data and sending it back to your client. You can also do this on the egress, meaning before if your microservice or if your application tries to go out and reach an external endpoint, you can redirect that transit to Envoy and have Envoy check whether that egress request is allowed or not. So you can use this exact same flow for Engress as well as egress. And again, if you see, we are still the main goal of OPA, which was to decouple the policy enforcement from the decision-making, it's pretty evident here. OPA makes the decision. Envoy's external authorization filter enforces that decision. So now, we've discussed ABI authorization, which is a problem of can this user execute this action on a specific resource. In the previous slide, we saw this how Envoy can be leveraged to make use of OPA. You can also use STO. You can also use Lincardine with similar mechanisms, wherein you have a plugin which calls out to OPA. OPA makes a decision and sends it back to your enforcement point for enforcing the final decision. So it's a very flexible model that can be used not just with Envoy, but with other service mesh solutions as well. So the API authorization problem in microservices it needs to be solved, right? Because we've seen that we have all these different applications. Each application is different from the other. And then how do you find a unified way to enforce policies in all these different applications? So we need to have a good solution. So OPA's declarative approach to policy enforcement and its general purpose nature allows us to define custom security policies and enforce them by injecting our application with an Envoy side card like the previous example, which is going to result in policy-enabled applications that are now ready to provide least privilege access. You can imagine a situation in which you have different microservices. Each microservice wants to enforce its custom policy so you can have OPA running alongside every microservice implementing that custom policy and packaging this together in deployment along with your network proxy like Envoy in this example. So this was a talk on OPA, which is an open source general purpose policy engine. And we've seen how it can act as a unified authorization language and administration toolset that works across all your microservices to enforce fine-grained security policies. If you want to learn more about OPA, check out the website openpolicyagent.org where you will find all these tutorials with Envoy, with Istio, with Kafka, with Kubernetes. You can try them out from the website as well. If you have any questions about OPA or if you have any use cases around OPA, you can join us on our Slack channel. And also it's an open source project so check out the source code on GitHub. And if you like what you see, please do start the project. So again, I'm Ash Narkar. I thank you all for sharing your time with me and I hope you enjoyed this talk about OPA and API authorization. Thank you. I'm open for questions now. I'm going to go across some questions. So the first question we have here is, can the policy be consolidated in a single policy where input user is either a manager or user him slash herself? So yeah, so Leonardo has this good question about can the policy be consolidated in a single policy where the user is either a manager or the user is him or herself. So yeah, you can consolidate the policy in a single policy. So OPA has this concept of packages. So you've seen packages in programming languages like Go has a package structure which allows you to streamline your code to that particular set of packages. So yeah, you can do the same thing. You can have multiple packages inside of OPA and then you can stitch them all together into a single high level policy and call individual packages for individual policy decisions just like you would do in any other programming language. So just quickly, if I have to show an example, so like you saw here, there's a package play. You could have had a package play one, play two, play three and then you can have like a top level package, say package or Z which calls individual packages, gets a decision, stitches it together and returns the final response to the user. So yeah, that's totally possible to consolidate everything into a single policy file in OPA. Okay, let's look at the next question. Srinivas has a question. Can this be sought as a replacement for OAuth that is in place for many microservices apps in place? This is an excellent question. So if you guys are familiar, if you all are familiar with the OAuth architecture, so the OAuth framework is essentially for third-party applications to gain access to a user's account. OPA is not a replacement for OAuth, but OPA can be supplement to OAuth. So for example, inside of the OAuth framework, you have the authorization server. So what you can do is that authorization server can be implemented using OPA. One of the other pieces of the OAuth framework is a generation of tokens. So you can have OPA generating the tokens based on some kind of an input. So yeah, so I would say OPA is not a replacement for OAuth, but OPA can be used along with OAuth in its different stages. And one thing with OAuth is that there are so many stages involved in the OAuth framework, there is an inherent latency associated with them. But if you're doing something like microservices, your latency is like in the order of microseconds. So you would typically not use OAuth as in a microservice environment. That is why OPA and OAuth have different use cases and they supplement each other pretty well. Not a replacement. So yeah, thank you Srinivas for that question. The next question is by Rodrigo, and it says that do you have any performance benchmark results of time and memory consuming? So yes, good question again. If you go to the OPA website, we have performance benchmarks of how the memory and how the time taken by the policy increases as you increase number of rules. So one thing to note here that as you increase the policies and as you increase and as you provide more and more data to OPA, it's going to consume more memory and it's going to probably take more time to make a policy decision.  And so we have examples of this on the website. There is a section around policy performance which you can check out which discusses all these optimizations OPA has to make everything run faster and also how you can manage memory when your data increases. Next question by LingWang. So the next question LingWang asks is what would be the overhead look like by offloading the on Z request to OPA? So great question, LingWang. There is obviously going to be some overhead involved when you are sending, when you are asking OPA for a policy decision. But again OPA is a very lightweight agent and also the decisions OPA makes they are in the order of microseconds and you can actually optimize them even further. So if your overall latency budget which is pretty tight for API authorization is in the order of say microseconds, OPA can definitely meet that demand. So yes there is an overhead but it is a very small overhead and it is especially designed for such high performance use cases. Okay, next question by Alejandra. How does OPA integrate with Terraform? Yes, so OPA has an integration with Terraform and especially the use case around here is if you want to test the changes Terraform is about to make before it actually makes them you can use OPA for that and there is a good step-by-step tutorial on the website Alejandra which I would recommend you to check out. Next question by Biao. How do you monitor failure of token request to OPA? Okay, how do you monitor the failure of token request to OPA? So whenever you call out to OPA OPA will either return to you the policy decision or it will return to you that it failed or it will return to you like an undefined or a false or something like that based on how you author your policies. So then it is up to your service which is calling out to OPA to interpret that decision. So for example in the example I showed before if allow was through your service would allow the request if allow was false it would deny the request. So it's up to your service how to interpret those results or those policy decisions which have been sent by OPA. Okay, next question is by Eric. In your opinion what is the best way to retrieve external data for making policy decisions? How can decisions be affected if we need to make HTTP calls? This is an excellent question Eric and it's come up a lot and it's come up so many times that we actually have an entire page dedicated to this question on the OPA website. But just to give you a quick understanding of this there are many ways you can push policies and data to OPA. One way is you can use the push model in which you can use OPA's REST APIs to push your policy and data into OPA. The other way and the way we recommend is the pull model in which OPA will periodically pull down your policies and data periodically from a remote HTTP server. So imagine if you have an HTTP server running somewhere you can point OPA to that server and OPA will periodically pull down policies and data and use that inside your policy. And one way to get policy is within the policy itself. So OPA has a built-in called as HTTP.Send which allows you to make HTTP calls from within the policy itself. So imagine as you're evaluating your policies inside of Rego you can make a call to your service fetch that data and then use that new data inside your policies to make a decision. So the bottom line here is that there are multiple ways you can feed OPA external data but it depends on your latency requirements and it depends on what you are trying to achieve. Okay, next question is by Paul. The question is where do the OPA policies live? Are they stored in an SEM or in an external DB? Again, great question and it kind of feeds off from the last question. You can store your OPA policies wherever you want. You can store them in your Git. So you can imagine that you can have your OPA policies inside of GitHub. You can do the same things you do for normal code. It goes through the entire PR process. You can then push those policies to master and then you can probably point OPA to your service and it pulls down those policies from GitHub. So that's one way you could do it. You could obviously store those policies on disk and have OPA load them from there as well as you can store them on your external servers point OPA to those servers and OPA will pull those down. So yeah, depending on your use case there are multiple ways you can store policies in OPA-OPA to get from. Next question is by Robert. The question is, would you kindly provide a link to download the slides later on? This is more of a question for the CNCF. I think we will provide a link to the slides later on but probably they can answer this question better. So yeah, so I just got a reply that yes, we will be making these slides available later. Robert, so yeah, you can access them later. So yeah, so I hope you all enjoyed this session and if you have more questions we are always available on Slack so you can join us there as well and thank you so much for joining me today. Thank you.


Studying William Shakespeare's play Macbeth? Let's discuss key quotations and word-level analysis relating to the character of Macbeth when he kills King Duncan. In Act 2 scene 2 after Macbeth kills King Duncan he is horrified by his actions. He says there's one did laugh in his sleep and one cried and the repetition of one shows his disgust with himself. He mentions murder and this exclamatory sentence shows his deep remorse at going against the King and committing Regicide. He later says God blesses and Amen and this religious language ties into the divine right of Kings. He is aware that he's gone against God's will by killing the King. The alliteration of age and had hang men in hands show that he feels like he's beyond redemption. He tells Lady Macbeth I could not say Amen and this declarative sentence shows how far he feels from God how disconnected after killing the King and going against divine right of King.