Comments (4)
The type argument of your AttributeProvider factory must extend AbstractAttributeProvider
indeed. In your AttributeProvider's XML schema (that defines the AttributeProvider's configuration model or format if you will), there must be a XML type that extends AbstractAttributeProvider
(namespace http://authzforce.github.io/xmlns/pdp/ext/3
), like TestAttributeProvider
(namespace http://authzforce.github.io/core/xmlns/test/3
) for example. As a result, the maven-jaxb2-plugin in your POM will generate a JAXB-annotated class from it (during the generate-sources
phase of the build with Maven) which extends org.ow2.authzforce.xmlns.pdp.ext.AbstractAttributeProvider
(also JAXB-annotated class corresponding to XML type AbstractAttributeProvider
). For example, the class org.ow2.authzforce.core.pdp.testutil.ext.xmlns.TestAttributeProvider
is generated from XML type TestAttributeProvider
(during the build of pdp-testutils
module). This JAXB-annotated class is the one you must use as type argument. So please check the JAXB classes generated (run maven generate-sources), one of them must extend AbstractAttributeProvider.
Use the TestAttributeProvider source code (for your version of authzforce-ce-core) as ultimate reference, if the doc is confusing or not up-to-date. Indeed, some class names were not up-to-date with the latest API:
- CloseableDesignatedAttributeProvider renamed to CloseableNamedAttributeProvider
- BaseDesignatedAttributeProvider renamed to BaseNamedAttributeProvider
Thanks for reporting that, I fixed the wiki page. Sorry for the confusion :-( .
from core.
thank you for answering but i still don't get it. in TestAttributeProvider class which is for reference we have
public class TestAttributeProvider extends BaseNamedAttributeProvider { ... }
and the factory class is like :
public static class Factory extends CloseableNamedAttributeProvider.FactoryBuilder<org.ow2.authzforce.core.pdp.testutil.ext.xmlns.TestAttributeProvider>
{
...
}
(what is that xmlns package? TestAttributeProvider package is org.ow2.authzforce.core.pdp.testutil.ext )
according to wiki this should work but it won't because BaseNamedAttributeProvider is not extended from AbstractAttributeProvider.
then according to what you answered something like
public class TestAttributeProvider
extends AbstractAttributeProvider implements CloseableNamedAttributeProvider { ... }
and using this type in factory will work. this is different from what wiki and reference TestAttributeProvider says.
from core.
As I said, the class ....xmlns.TestAttributeProvider - and so the xmlns package you are refering to - is generated automatically by Maven during the build. You will NOT find it anywhere in authzforce source code, because it is generated source code. This is different from the class ....ext.TestAttributeProvider (different package!). The one in the xmlns package is your XML type mapped to Java (using JAXB), it is automatically generated by maven-jaxb2-plugin, and only represents the configuration parameters to your Attribute Provider. (Maybe we should name it TestAttributeProviderConfiguration to make the difference less subtle.) The other one is a class that must be written by you to implement the actual Attribute Provider's logic (retrieving the attribute(s)).
So, again, what you should do first, is run $ mvn generate-sources
as told on the wiki; make sure some Java classes are generated by this command (based on your XML schema). They should end up in target/generated-sources/xjc
usually or something like that. In any case, they should be automatically added to the build path. Finally, make sure that one of these generated class extends AbstractAttributeProvider
. Let me know what class is there. It will be the type arg to your factory.
We don't mention BaseNamedAttributeProvider
yet at this point, this is for the AttributeProvider's logic implementation.
from core.
thank you for answering. i think now i get it now. i was confused because of the same class names. i'm going to try again for creating custom attribute provider.
from core.
Related Issues (20)
- Test failed on authzforce-ce-core-pdp-testutils module version 17.0.0 HOT 1
- Compilation failure due to XacmlJsonUtils.canonicalizeResponse method signature issue HOT 1
- Use latest parent version to benefit from dependency-check-maven fix
- Implementation help HOT 8
- org.ow2.authzforce.core.pdp.testutil.ext.xsd MongoDBPolicyProvider ServerHost Pattern HOT 2
- Question about Evaluating Requests in XACML/JSON format HOT 4
- Support XACML <VariableRef> in <Match> via AttributeDesignator workaround
- Refactor BasePdpEngine - Move the StandardEnvironmentAttribute* code to dedicated AttributeProvider
- Mutli requests in the use of CLI HOT 2
- Issue in building the project using cmd HOT 3
- Enable PDP extensions (e.g. Functions) to return an error about invalid attribute values in form of XACML <StatusDetail> / <MissingAttributeDetail>s HOT 3
- org.ow2.authzforce.domains.xacmlJsonSchemaRelativePath has no effect HOT 1
- clientRequestErrorVerbosityLevel > 0 throws startup exception HOT 1
- ConditionEvaluators.java -> throwing exception when conditional evaluates to false.
- The permit-unless-deny in policySet and policy produce an error HOT 3
- Is it possible to bound a jaxb scope for authzforce HOT 3
- Timeline for migrating the javax namespace HOT 2
- Migrate to Java 17+
- Deny-overrides rule combining algorithm - Missing obligations in case of multiple Permit Rules and no Deny Rule HOT 1
- Comparison by issuer even if it is not defined in AttributeDesignator HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from core.