public ClaimsAuthorizationSegment(
     IReadOnlyList <AuthorizationSegmentEndpointWithValue> claimsEndpoints,
     AuthorizationSegmentEndpoint subjectEndpoint,
     string authorizationPathModifier)
 {
     ClaimsEndpoints           = claimsEndpoints;
     SubjectEndpoint           = subjectEndpoint;
     AuthorizationPathModifier = authorizationPathModifier;
 }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ExistingValuesAuthorizationSegment"/> class using the supplied endpoints.
        /// </summary>
        /// <param name="endpoint1">One of the endpoints of the segment.</param>
        /// <param name="endpoint2">Another endpoint in the segment.</param>
        /// <param name="authorizationPathModifier">A value that identifies an alternative path through the ODS data model for authorization.</param>
        public ExistingValuesAuthorizationSegment(
            AuthorizationSegmentEndpoint endpoint1,
            AuthorizationSegmentEndpoint endpoint2,
            string authorizationPathModifier)
        {
            Endpoints = new List<AuthorizationSegmentEndpoint>
                        {
                            endpoint1, endpoint2
                        }
               .AsReadOnly();

            AuthorizationPathModifier = authorizationPathModifier;
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ClaimsAuthorizationSegment"/> class using the supplied claim values and target endpoint.
        /// </summary>
        /// <param name="claimNamesAndValues">The claim names and values, represented as a collection of tuples.</param>
        /// <param name="subjectEndpoint">The endpoint representing the subject of authorization.</param>
        /// <param name="authorizationPathModifier">A value that identifies an alternative path through the ODS data model for authorization.</param>
        public ClaimsAuthorizationSegment(
            IEnumerable <Tuple <string, object> > claimNamesAndValues,
            AuthorizationSegmentEndpoint subjectEndpoint,
            string authorizationPathModifier)
        {
            ClaimsEndpoints = claimNamesAndValues
                              .Select(
                cv =>
                new AuthorizationSegmentEndpointWithValue(
                    cv.Item1,
                    cv.Item2.GetType(),
                    cv.Item2))
                              .ToList()
                              .AsReadOnly();

            SubjectEndpoint           = subjectEndpoint;
            AuthorizationPathModifier = authorizationPathModifier;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ClaimsAuthorizationSegment"/> class using the supplied claim values and target endpoint.
 /// </summary>
 /// <param name="claimNamesAndValues">The claim names and values, represented as a collection of tuples.</param>
 /// <param name="subjectEndpoint"></param>
 public ClaimsAuthorizationSegment(IEnumerable <Tuple <string, object> > claimNamesAndValues, AuthorizationSegmentEndpoint subjectEndpoint)
     : this(claimNamesAndValues, subjectEndpoint, null)
 {
 }
Esempio n. 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExistingValuesAuthorizationSegment"/> class using the supplied endpoints.
 /// </summary>
 /// <param name="endpoint1">One of the endpoints of the segment.</param>
 /// <param name="endpoint2">Another endpoint in the segment.</param>
 public ExistingValuesAuthorizationSegment(
     AuthorizationSegmentEndpoint endpoint1,
     AuthorizationSegmentEndpoint endpoint2)
     : this(endpoint1, endpoint2, null) { }